-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.config.js
More file actions
27 lines (25 loc) · 833 Bytes
/
jest.config.js
File metadata and controls
27 lines (25 loc) · 833 Bytes
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
// jest.config.js
const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig.json");
module.exports = {
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: "<rootDir>/",
jsonwebtoken: "<rootDir>/src/__mocks__/jsonwebtoken",
"@appquality/wp-auth": "<rootDir>/src/__mocks__/@appquality-wp-auth",
}),
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}", "!<rootDir>/node_modules/"],
testMatch: ["**/?(*.)+(spec|test).[jt]s?(x)"],
setupFiles: ["<rootDir>/src/__mocks__/mocks.ts"],
setupFilesAfterEnv: ["<rootDir>/src/__mocks__/globalSetup.ts"],
preset: "ts-jest",
testEnvironment: "node",
testTimeout: 3000,
transform: {
"^.+\\.(t|j)sx?$": ["@swc/jest"],
},
globals: {
"ts-jest": {
isolatedModules: true,
},
},
};