-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
42 lines (37 loc) · 1.03 KB
/
jest.config.js
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
41
42
const root = '<rootDir>'
const codeDir = `${root}/src`;
const testDir = `${root}/src/__tests__`;
/** @type {import('ts-jest').JestConfigWithTsJest} **/
module.exports = {
testEnvironment: "node",
transform: {
"^.+.tsx?$": ["ts-jest",{}],
},
verbose: true,
//Get test coverage
// collectCoverage: true,
// collectCoverageFrom: [
// `${codeDir}/**/*.ts`,
// `!**/__tests__/**`
// ],
//Run test from this folder(s) only
testMatch: [
`${testDir}/**/*.test.ts`
],
testPathIgnorePatterns: [
`${testDir}/test_utils`
],
// transform: {
// "^.+\\.[t|j]sx?$": "babel-jest"
// },
setupFiles: [
`${testDir}/test_utils/env.ts`,
`${testDir}/test_utils/disable-console-log.ts`
],
setupFilesAfterEnv: [
`${testDir}/test_utils/connect-to-db.ts`,
`${testDir}/test_utils/add-custom-matchers.ts`
],
globalSetup: `${testDir}/test_utils/globalSetup.ts`,
globalTeardown: `${testDir}/test_utils/globalTeardown.ts`,
};