This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
jest.config.js
58 lines (55 loc) · 1.72 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// @ts-check
const CI = process.env.CI === '1'
const ARTIFACT_DIR = process.env.ARTIFACT_DIR || 'artifacts'
const IS_E2E = process.env.E2E === '1'
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
...(CI && {
reporters: [
'default',
[
'jest-junit',
{
suiteName: 'Jest Tests',
outputDirectory: `${ARTIFACT_DIR}/test_results/jest/`,
outputName: 'jest.junit.xml',
},
],
],
collectCoverage: true,
}),
transform: {
'^.+\\.tsx?$': require.resolve('ts-jest'),
},
setupFiles: ['<rootDir>/testUtils/setup.ts'],
coverageReporters: CI ? ['json'] : ['text', 'json'],
coverageDirectory: 'raw-coverage/jest/',
collectCoverageFrom: ['packages/**/src/**/*.ts', '.yarn/__virtual__/**/packages/**/*.ts'],
coveragePathIgnorePatterns: ['/node_modules/', '/__mocks__/', '\\.test.ts$', '\\.mock.ts$'],
watchPathIgnorePatterns: [
'<rootDir>/example-monorepo',
'<rootDir>/artifacts',
'<rootDir>/packages/.*/lib',
'<rootDir>/packages/.*/.*\\.js',
],
testPathIgnorePatterns: [
'/node_modules/',
'/.yarn/',
'<rootDir>/.*\\.js',
'<rootDir>/.*/lib/',
...(IS_E2E ? ['<rootDir>/packages'] : ['<rootDir>/e2e-tests']),
],
haste: {
throwOnModuleCollision: true,
},
modulePathIgnorePatterns: ['<rootDir>/.*/lib'],
testTimeout: 30000,
resolver: require.resolve('@tophat/jest-resolver'),
...(IS_E2E && {
maxConcurrency: 1,
maxWorkers: 1,
testTimeout: 300000,
verbose: true,
}),
}
module.exports = config