Skip to content

Commit 9fabf05

Browse files
committed
test: configure jest in typescript
1 parent f0d23ed commit 9fabf05

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

jest.config.mjs renamed to jest.config.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
/** @typedef {import("jest")} jestConfig */
2-
const jestConfig = {
1+
import type { JestConfigWithTsJest } from "ts-jest"
2+
3+
const jestConfig: JestConfigWithTsJest = {
4+
testMatch: ["**/*.test.ts"],
5+
testEnvironment: "node",
6+
// transform configurations
37
preset: "ts-jest/presets/js-with-ts-esm",
48
extensionsToTreatAsEsm: [".ts"],
5-
transformIgnorePatterns: [], // transform everything
6-
testEnvironment: "node",
7-
testMatch: ["**/*.test.ts"],
8-
testPathIgnorePatterns: ["<rootDir>/src/python/setup-python/"],
9-
// tsconfig
9+
transformIgnorePatterns: [], // transform node_modules
1010
transform: {
1111
"^.+\\.tsx?$": [
1212
"ts-jest",
13-
/** @type {import("ts-jest")} */
1413
{
1514
importHelpers: true,
1615
useESM: true,

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"./src",
3333
"dev/scripts",
3434
"packages/untildify-user/untildify.ts",
35-
"dev/docker/__tests__/generate-docker-tests.mjs"
35+
"dev/docker/__tests__/generate-docker-tests.mjs",
36+
"./jest.config.ts"
3637
]
3738
}

0 commit comments

Comments
 (0)