Skip to content

Commit 8875bf9

Browse files
committed
test(jest): update config and add @jest/globals dev dependency
1 parent 66fcf52 commit 8875bf9

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

jest.config.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
import type { Config } from "@jest/types";
1+
import type { JestConfigWithTsJest } from "ts-jest";
22

3-
const config: Config.InitialOptions = {
4-
extensionsToTreatAsEsm: [".ts"],
3+
const config = {
4+
preset: "ts-jest/presets/default-esm",
5+
moduleFileExtensions: ["ts", "js"],
56
setupFilesAfterEnv: ["./jest.setup.ts"],
67
moduleNameMapper: {
78
"^(\\.{1,2}/.*)\\.js$": "$1",
89
},
9-
transform: {
10-
"^.+\\.ts$": [
11-
"ts-jest",
12-
{
13-
useESM: true,
14-
},
15-
],
16-
},
17-
};
10+
} satisfies JestConfigWithTsJest;
1811

19-
export default config;
12+
module.exports = config;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"@eslint/compat": "^1.2.5",
6262
"@eslint/eslintrc": "^3.2.0",
6363
"@eslint/js": "^9.19.0",
64+
"@jest/globals": "29.7.0",
6465
"@jest/types": "29.0.0",
6566
"@types/inflection": "^1.13.0",
6667
"@types/jest": "^29.0.0",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)