-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
40 lines (40 loc) · 1.04 KB
/
jest.config.js
File metadata and controls
40 lines (40 loc) · 1.04 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
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^ink-testing-library$': '<rootDir>/node_modules/ink-testing-library/build/index.js',
},
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
useESM: true,
tsconfig: {
jsx: 'react-jsx',
moduleResolution: 'node',
},
},
],
},
transformIgnorePatterns: [
'node_modules/(?!(ink-testing-library|ink|cli-boxes|ansi-regex|string-width|strip-ansi|ansi-escapes|chalk|escape-string-regexp|wrap-ansi|slice-ansi)/)'
],
testMatch: ['**/__tests__/**/*.(test|spec).(ts|tsx)'],
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/index.ts',
],
coverageThreshold: {
global: {
branches: 65,
functions: 40,
lines: 65,
statements: 65,
},
},
coverageReporters: ['text', 'lcov', 'html'],
setupFilesAfterEnv: ['<rootDir>/__tests__/setup.ts'],
};