renovate/jest.config.ts

48 строки
1.3 KiB
TypeScript
Исходник Обычный вид История

2021-03-02 19:16:05 +03:00
import type { InitialOptionsTsJest } from 'ts-jest/dist/types';
2020-02-28 11:25:14 +03:00
const ci = !!process.env.CI;
2021-03-02 19:16:05 +03:00
const config: InitialOptionsTsJest = {
preset: 'ts-jest',
2020-02-28 11:25:14 +03:00
cacheDirectory: '.cache/jest',
coverageDirectory: './coverage',
collectCoverage: true,
collectCoverageFrom: [
'lib/**/*.{js,ts}',
'!lib/**/*.{d,spec}.ts',
'!lib/**/{__fixtures__,__mocks__,__testutil__,test}/**/*.{js,ts}',
2021-03-02 23:44:55 +03:00
'!lib/**/types.ts',
2020-02-28 11:25:14 +03:00
],
coverageReporters: ci
2020-02-28 14:19:18 +03:00
? ['html', 'json', 'text-summary']
: ['html', 'text-summary'],
2020-02-28 11:25:14 +03:00
coverageThreshold: {
global: {
branches: 98,
2020-02-28 11:25:14 +03:00
functions: 100,
lines: 100,
statements: 100,
},
},
2021-05-26 11:27:39 +03:00
modulePathIgnorePatterns: ['<rootDir>/dist/', '/__fixtures__/'],
2021-08-27 16:58:50 +03:00
reporters: ci ? ['default', 'jest-github-actions-reporter'] : ['default'],
setupFilesAfterEnv: [
'jest-extended/all',
'expect-more-jest',
'<rootDir>/test/setup.ts',
],
2020-02-28 11:25:14 +03:00
snapshotSerializers: ['<rootDir>/test/newline-snapshot-serializer.ts'],
2020-05-15 14:50:34 +03:00
testEnvironment: 'node',
testRunner: 'jest-circus/runner',
watchPathIgnorePatterns: ['<rootDir>/.cache/', '<rootDir>/coverage/'],
2021-03-02 19:16:05 +03:00
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
2021-03-02 19:16:05 +03:00
diagnostics: false,
2021-03-02 23:44:55 +03:00
isolatedModules: true,
2021-03-02 19:16:05 +03:00
},
2020-02-28 11:25:14 +03:00
},
};
2021-03-02 19:16:05 +03:00
export default config;