generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.mjs
50 lines (49 loc) · 1.27 KB
/
jest.config.mjs
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
// See: https://jestjs.io/docs/configuration
/** @type {import('@jest/types').Config.InitialOptions} **/
export default {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: ['./src/**'],
coverageDirectory: './coverage',
coveragePathIgnorePatterns: [
'__mocks__',
'/node_modules/',
'/dist/',
'src/schema/'
],
coverageReporters: ['json-summary', 'text', 'lcov'],
coverageThreshold: {
global: {
branches: 49, // 85 coverage required
functions: 85, // 85 coverage required
lines: 85, // 85 coverage required
statements: 85 // 85 coverage required
}
},
extensionsToTreatAsEsm: ['.ts'],
moduleFileExtensions: ['ts', 'js'],
preset: 'ts-jest',
reporters: ['default'],
resolver: 'ts-jest-resolver',
setupFilesAfterEnv: [
'<rootDir>/tsconfig.json',
'<rootDir>/tsconfig.eslint.json'
],
testEnvironment: 'node',
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
testPathIgnorePatterns: ['/dist/', '/node_modules/', '__mocks__'],
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.eslint.json',
useESM: true
}
]
},
transformIgnorePatterns: [
'node_modules/(?!@jest/)',
'.*\\.(spec|test)\\.(js|jsx)$'
],
verbose: true
};