Skip to content

Commit

Permalink
Get tests working with new esm import statements.
Browse files Browse the repository at this point in the history
This involved adding a jest-ts-webcompat-resolver, because
jest's resolver doesn't like importing ".js" files that are
actually ".ts" files unlike tsc, which is fine with it.

See kulshekhar/ts-jest#1057
  • Loading branch information
johndaniels committed Jun 6, 2021
1 parent ec1fb03 commit 4d8eedc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
26 changes: 22 additions & 4 deletions package-lock.json

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

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "0.1.0",
"description": "",
"main": "dist/index.js",
"files":["dist/**.js"],
"files": [
"dist/**.js"
],
"scripts": {
"build": "tsc",
"test": "node --experimental-vm-modules node_modules/.bin/jest",
Expand All @@ -19,13 +21,17 @@
"@typescript-eslint/eslint-plugin": "^4.26.0",
"eslint": "^7.28.0",
"jest": "^27.0.4",
"jest-ts-webcompat-resolver": "^1.0.0",
"ts-jest": "^27.0.2",
"typescript": "^4.3.2",
"typescript-eslint": "^0.0.1-alpha.0"
},
"jest": {
"preset": "ts-jest/presets/default-esm",
"roots": ["src"],
"resolver": "jest-ts-webcompat-resolver",
"roots": [
"src"
],
"globals": {
"ts-jest": {
"useESM": true
Expand Down

0 comments on commit 4d8eedc

Please sign in to comment.