-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathjest.config.cjs
More file actions
39 lines (39 loc) · 1.47 KB
/
jest.config.cjs
File metadata and controls
39 lines (39 loc) · 1.47 KB
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
module.exports = {
preset: "ts-jest/presets/js-with-ts-esm",
testEnvironment: "node",
transform: {
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
useESM: true,
tsconfig: "tsconfig.json",
},
],
},
extensionsToTreatAsEsm: [".ts", ".tsx"],
moduleFileExtensions: ["js", "jsx", "ts", "tsx", "json", "node"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
"\\.(css)$": "<rootDir>/src/__mocks__/styleMock.ts",
"^~/(.*)$": "<rootDir>/src/$1",
"^@api/(.*)$": "<rootDir>/src/pages/api/$1",
"^@components": "<rootDir>/src/components/index.ts",
"^@components/(.*)$": "<rootDir>/src/components/$1",
"^@config$": "<rootDir>/src/config/index.ts",
"^@config/(.*)$": "<rootDir>/src/config/$1",
"^@features/(.*)$": "<rootDir>/src/features/$1",
"^@graphql$": "<rootDir>/src/graphql/index.ts",
"^@graphql/(.*)$": "<rootDir>/src/graphql/$1",
"^@stores/(.*)$": "<rootDir>/src/stores/$1",
"^@utils$": "<rootDir>/src/utils/index.ts",
"^@utils/(.*)$": "<rootDir>/src/utils/$1",
"^@variables$": "<rootDir>/src/config/markdown-variables.ts",
"^@abi$": "<rootDir>/src/features/abi/index.ts",
"^@lib$": "<rootDir>/src/lib/index.ts",
"^@lib/(.*)\\.js$": "<rootDir>/src/lib/$1",
"^@lib/(.*)$": "<rootDir>/src/lib/$1",
"\\.ya?ml$": "<rootDir>/src/__mocks__/yamlMock.ts",
},
transformIgnorePatterns: ["/node_modules/(?!.*\\.mjs$)"],
testPathIgnorePatterns: ["/node_modules/", "src/tests/chain-api.test.ts"],
}