Skip to content

Commit 815352d

Browse files
committed
test: update jest config for ESM
1 parent 247c064 commit 815352d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint:fix": "prettier --write '{src,test,scripts}/**/*' README.md package.json",
1313
"pretest": "npm run -s lint",
1414
"test": "npm run -s test:node && npm run -s test:web",
15-
"test:node": "jest --coverage",
15+
"test:node": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest --coverage",
1616
"test:web": "npm run test:deno && npm run test:browser",
1717
"pretest:web": "npm run -s build",
1818
"test:deno": "cd test/deno && deno test",
@@ -42,11 +42,15 @@
4242
"typescript": "^5.0.0"
4343
},
4444
"jest": {
45+
"extensionsToTreatAsEsm": [
46+
".ts"
47+
],
4548
"transform": {
4649
"^.+\\.(ts|tsx)$": [
4750
"ts-jest",
4851
{
49-
"tsconfig": "test/tsconfig.test.json"
52+
"tsconfig": "test/tsconfig.test.json",
53+
"useESM": true
5054
}
5155
]
5256
},

0 commit comments

Comments
 (0)