Skip to content

Commit

Permalink
test: use jest-light-runner for tests
Browse files Browse the repository at this point in the history
Due to nodejs/node#35889, jest does not
currently work well when using `import()` in CJS/ESM modules.

However, jest-light-runner doesn't have this issue.
  • Loading branch information
aloisklink committed Aug 23, 2022
1 parent a77ca8d commit 1b2bfc9
Show file tree
Hide file tree
Showing 4 changed files with 320 additions and 65 deletions.
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ module.exports = {
// look for test.mjs files
"**/?(*.)+(spec|test).?([cm])[tj]s?(x)",
],
// work around for https://github.com/nodejs/node/issues/35889#issuecomment-1129293091
runner: "jest-light-runner",
};
215 changes: 214 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
"unist-util-visit": "^2.0.3"
},
"devDependencies": {
"@jest/globals": "^28.1.2",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^8.0.1",
"jest": "^28.1.2",
"jest-image-snapshot": "^5.1.0",
"jest-light-runner": "^0.3.0",
"lint-staged": "^13.0.3",
"prettier": "^2.2.1",
"puppeteer": "^16.0.0",
Expand Down
Loading

0 comments on commit 1b2bfc9

Please sign in to comment.