adobe / adobe/target-nodejs-sdk

Node v20 + Jest = Polyfill error with fast-text-encoding

Open
#121 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
26
Forks
22
PR merge metrics
No merged PRs in 30d

Description

### Expected Behaviour
SDK should not have polyfill issues when running Jest tests

### Actual Behaviour
SDK has polyfill TypeError when running Jest tests
![Screen Shot 2023-07-05 at 12 29 53 AM](https://github.com/adobe/target-nodejs-sdk/assets/12564636/887fc80f-972e-4ce3-b843-a7bf76e1a37e)

#### Steps to Reproduce
Readme describes it best: https://github.com/hochoy/adobe-target-jest-node-compatibility/blob/main/README.md
The bug is reproduced in the minimal repo above.

Here's the gist of it
```shell
npm i @adobe/target-nodejs-sdk
npm i --save-dev jest

touch index.js
# import the sdk
touch index.test.js
# write a jest test requiring the MarketingCloudClient

nvm install 20
nvm use 20
npx jest index.test.js

```

#### Platform and Version
@adobe/target-nodejs-sdk v2.4.3
node v20.3.1
jest v29.6.0

#### Sample Code that illustrates the problem
https://github.com/hochoy/adobe-target-jest-node-compatibility/tree/main

#### Logs taken while reproducing problem

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.