-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.config.ts
More file actions
37 lines (31 loc) · 1008 Bytes
/
jest.config.ts
File metadata and controls
37 lines (31 loc) · 1008 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
28
29
30
31
32
33
34
35
36
37
import type { Config } from 'jest';
const root = '<rootDir>';
const codeDir = `${root}/src`;
const testDir = `${root}/src/__tests__`;
const config: Config = {
verbose: true,
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '.',
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
},
testEnvironment: 'node',
testMatch: [`${testDir}/**/*.test.ts`],
testPathIgnorePatterns: [`${testDir}/test_utils`],
collectCoverageFrom: [`${codeDir}/**/*.ts`],
coverageDirectory: './coverage',
coverageReporters: ['cobertura'],
reporters: ['default', 'jest-junit'],
setupFiles: [
`${testDir}/test_utils/env.ts`,
`${testDir}/test_utils/disable-console-log.ts`,
],
setupFilesAfterEnv: [
`${testDir}/test_utils/before-and-after-tests.ts`,
`${testDir}/test_utils/global-mocks.ts`,
`${testDir}/test_utils/add-custom-matchers.ts`,
],
globalSetup: `${testDir}/test_utils/globalSetup.ts`,
globalTeardown: `${testDir}/test_utils/globalTeardown.ts`,
};
export default config;