/
jest.config.ts
42 lines (39 loc) · 1.14 KB
/
jest.config.ts
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
import type { Config } from 'jest'
const CI = process.env.CI === '1'
const ARTIFACT_DIR = process.env.ARTIFACT_DIR || 'artifacts'
const config: Config = {
...(CI && {
reporters: [
'default',
[
'jest-junit',
{
suiteName: 'Jest Tests',
outputDirectory: `${ARTIFACT_DIR}/test_results/jest/`,
outputName: 'jest.junit.xml',
},
],
],
collectCoverage: true,
}),
transform: {
'^.+\\.[jt]sx?$': 'ts-jest',
},
coverageReporters: CI ? ['lcov'] : ['text-summary', 'lcov'],
coverageDirectory: `${ARTIFACT_DIR}/test_results/jest/`,
collectCoverageFrom: [
'**/src/**/*.{js,ts,tsx}',
'!**/*.test.{js,ts,tsx}',
'!**/lib/**',
],
watchPathIgnorePatterns: [
'<rootDir>/artifacts',
'<rootDir>/packages/.*/lib',
],
testPathIgnorePatterns: ['/node_modules/', '/.yarn/', '<rootDir>/.*/lib/'],
haste: {
throwOnModuleCollision: true,
},
modulePathIgnorePatterns: ['<rootDir>/.*/lib'],
}
export default config