diff --git a/packages/sitecore-jss-nextjs/package.json b/packages/sitecore-jss-nextjs/package.json index 19a6076551..008a1db1b8 100644 --- a/packages/sitecore-jss-nextjs/package.json +++ b/packages/sitecore-jss-nextjs/package.json @@ -8,7 +8,7 @@ "build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json", "clean": "del-cli dist types", "lint": "eslint ./src/**/*.tsx ./src/**/*.ts", - "test": "mocha --require ts-node/register/transpile-only --require ./src/tests/shim.ts ./src/tests/jsdom-setup.ts ./src/tests/enzyme-setup.ts \"./src/**/*.test.ts\" \"./src/**/*.test.tsx\" --exit", + "test": "mocha --require ./test/setup.js \"./src/**/*.test.ts\" \"./src/**/*.test.tsx\" --exit", "prepublishOnly": "npm run build", "coverage": "nyc npm test", "generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --readme none --out ../../ref-docs/sitecore-jss-nextjs src/index.ts --githubPages false" @@ -49,6 +49,7 @@ "enzyme": "^3.10.0", "eslint": "^7.15.0", "eslint-plugin-react": "^7.21.5", + "isomorphic-fetch": "^3.0.0", "jsdom": "^15.1.1", "mocha": "^8.1.3", "next": "^12.1.0", diff --git a/packages/sitecore-jss-nextjs/test/setup.js b/packages/sitecore-jss-nextjs/test/setup.js new file mode 100644 index 0000000000..6c4e837ef7 --- /dev/null +++ b/packages/sitecore-jss-nextjs/test/setup.js @@ -0,0 +1,5 @@ +require('ts-node/register/transpile-only'); +require('isomorphic-fetch'); +require('../src/tests/shim.ts'); +require('../src/tests/jsdom-setup.ts'); +require('../src/tests/enzyme-setup.ts'); diff --git a/yarn.lock b/yarn.lock index 2b3e20ea78..9cbbd1f57b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3906,6 +3906,7 @@ __metadata: enzyme: ^3.10.0 eslint: ^7.15.0 eslint-plugin-react: ^7.21.5 + isomorphic-fetch: ^3.0.0 jsdom: ^15.1.1 mocha: ^8.1.3 next: ^12.1.0