generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
36 lines (33 loc) · 891 Bytes
/
jest.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/
import type {JestConfigWithTsJest} from "ts-jest"
const esModules = ["@middy"].join("|")
const jestConfig: JestConfigWithTsJest = {
preset: "ts-jest/presets/default-esm",
moduleFileExtensions: ["js", "json", "ts", "d.ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
transform: {
"^.+\\.ts?$": [
"ts-jest",
{
useESM: true,
tsconfig: "./tsconfig.json"
}
]
},
clearMocks: true,
collectCoverage: true,
coverageDirectory: "coverage",
coverageProvider: "v8",
testMatch: ["**/tests/*.test.ts"],
testEnvironment: "node",
extensionsToTreatAsEsm: [".ts"],
verbose: true,
transformIgnorePatterns: [`node_modules/(?!${esModules})`],
rootDir: "./"
}
export default jestConfig