-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.ts
40 lines (38 loc) · 1 KB
/
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
37
38
39
40
import { pathsToModuleNameMapper } from 'ts-jest';
import type { JestConfigWithTsJest } from 'ts-jest';
import { compilerOptions } from './tsconfig.paths.json';
export default {
roots: [
"<rootDir>/src",
"<rootDir>",
],
preset: "ts-jest",
setupFilesAfterEnv: [
"./src/setupTests.ts",
],
testEnvironment: "jest-environment-jsdom",
modulePaths: [compilerOptions.baseUrl],
testMatch: [
"**/?(*.)+(spec).+(ts|tsx|js)",
],
transform: {
"^.+\\.(ts|tsx)$": "ts-jest",
"^.+\\.ts$": "ts-jest",
},
transformIgnorePatterns: [
"/node_modules/(?!lodash-es)",
],
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
},
moduleDirectories: [
"node_modules",
"src",
],
globals: {
"ts-jest": {
"tsconfig": "tsconfig.json",
},
},
} as JestConfigWithTsJest;