Skip to content

Commit

Permalink
Run tests in Node.js for ES modules support
Browse files Browse the repository at this point in the history
Jest currently uses Babel to transform ES modules to CommonJS (and doesn’t support dynamic import)

https://jestjs.io/docs/ecmascript-modules

This change avoids Node.js VM modules and lets Stylelint v16 use dynamic imports to prevent throwing:

```
TypeError: A dynamic import callback was invoked without --experimental-vm-modules
```
  • Loading branch information
colinrotherham committed Jan 8, 2024
1 parent 17e528f commit 67f764b
Show file tree
Hide file tree
Showing 3 changed files with 719 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
// Run tests in Node.js for ES modules support
// See: https://jestjs.io/docs/ecmascript-modules
runner: 'jest-light-runner'
}
Loading

0 comments on commit 67f764b

Please sign in to comment.