Skip to content

Commit

Permalink
fix: fix jest-ts example (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue authored Jul 30, 2024
1 parent aba131d commit 04817b5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
13 changes: 4 additions & 9 deletions with-jest-ts/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { createDefaultPreset } from "ts-jest";

/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
Expand All @@ -11,14 +13,7 @@ const config = {

extensionsToTreatAsEsm: [".ts", ".tsx"],

// https://kulshekhar.github.io/ts-jest/docs/guides/esm-support/
preset: "ts-jest/presets/default-esm",

globals: {
"ts-jest": {
useESM: true,
},
},
transform: { ...createDefaultPreset().transform },
};

module.exports = config;
export default config;
1 change: 1 addition & 0 deletions with-jest-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "with-jest-ts",
"version": "1.0.0",
"description": "",
"type": "module",
"scripts": {
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest"
},
Expand Down
5 changes: 4 additions & 1 deletion with-jest-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"compilerOptions": {
"moduleResolution": "Node"
"module": "NodeNext",
"target": "ESNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true
}
}

0 comments on commit 04817b5

Please sign in to comment.