-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjest.config.js
More file actions
43 lines (43 loc) · 1.01 KB
/
jest.config.js
File metadata and controls
43 lines (43 loc) · 1.01 KB
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
export default {
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts'],
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testMatch: [
'**/tests/unit/**/*.test.ts',
'**/src/**/*.test.ts'
// Integration tests excluded by default (run with: npm test -- tests/integration)
],
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.test.ts',
'!src/cli.ts',
'!src/types/**/*'
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
globals: {
'ts-jest': {
useESM: true,
tsconfig: {
rootDir: '.',
outDir: '.jest-cache',
skipLibCheck: true,
noUncheckedIndexedAccess: false,
},
},
},
transform: {
'^.+\\.ts$': ['ts-jest', {
useESM: true,
}],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^chalk$': '<rootDir>/tests/__mocks__/chalk.ts'
},
transformIgnorePatterns: [
'node_modules/(?!(p-queue|eventemitter3)/)'
],
testTimeout: 10000,
};