forked from renovatebot/renovate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
48 lines (45 loc) · 1.28 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
43
44
45
46
47
48
import type { InitialOptionsTsJest } from 'ts-jest/dist/types';
const ci = !!process.env.CI;
const config: InitialOptionsTsJest = {
preset: 'ts-jest',
cacheDirectory: '.cache/jest',
coverageDirectory: './coverage',
collectCoverage: true,
collectCoverageFrom: [
'lib/**/*.{js,ts}',
'!lib/**/*.{d,spec}.ts',
'!lib/**/{__fixtures__,__mocks__,__testutil__,test}/**/*.{js,ts}',
'!lib/**/types.ts',
],
coverageReporters: ci
? ['html', 'json', 'text-summary']
: ['html', 'text-summary'],
coverageThreshold: {
global: {
branches: 98,
functions: 100,
lines: 100,
statements: 100,
},
},
modulePathIgnorePatterns: ['<rootDir>/dist/', '/__fixtures__/'],
reporters: ci ? ['default', 'github-actions'] : ['default'],
setupFilesAfterEnv: [
'jest-extended/all',
'expect-more-jest',
'<rootDir>/test/setup.ts',
'<rootDir>/test/to-migrate.ts',
],
snapshotSerializers: ['<rootDir>/test/newline-snapshot-serializer.ts'],
testEnvironment: 'node',
testRunner: 'jest-circus/runner',
watchPathIgnorePatterns: ['<rootDir>/.cache/', '<rootDir>/coverage/'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
diagnostics: false,
isolatedModules: true,
},
},
};
export default config;