-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
46 lines (46 loc) · 1.18 KB
/
jest.config.js
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
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest/presets/default-esm',
testPathIgnorePatterns: [
'<rootDir>/__tests__/config/*',
'<rootDir>/__tests__/browser/*',
],
globalSetup: '<rootDir>/__tests__/config/setup.test.ts',
globalTeardown: '<rootDir>/__tests__/config/teardown.test.ts',
collectCoverage: true,
coverageDirectory: 'coverage',
collectCoverageFrom: ['src/**/*.ts', 'src/**/**/*.ts', '!src/**/*.d.ts'],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
},
'./src/index.ts': {
statements: 100,
},
},
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^(\\.{1,2}/.*)\\.ts$': '$1',
},
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
tsconfig: 'tsconfig.test.json',
isolatedModules: true,
diagnostics: {
ignoreCodes: ['TS151001'],
},
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testMatch: ['**/__tests__/**/*.test.ts'],
verbose: true,
setupFilesAfterEnv: ['jest-extended'],
};