-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjest.config.ts
57 lines (55 loc) · 1.43 KB
/
jest.config.ts
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
51
52
53
54
55
56
57
// import type { Config } from 'jest';
import { defaults } from 'jest-config';
import type { JestConfigWithTsJest } from 'ts-jest';
const config: JestConfigWithTsJest = {
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '.',
testRegex: defaults.testRegex,
transform: {
'^.+\\.(t|j)s$': [
'ts-jest',
{
useESM: true,
tsconfig: '<rootDir>/test/tsconfig.json',
},
],
},
testEnvironment: 'jest-environment-node',
testPathIgnorePatterns: [
'<rootDir>/src/client',
'<rootDir>/dist/',
'<rootDir>/tmp/',
'<rootDir>/node_modules/',
'<rootDir>/local_tests/',
],
testTimeout: 20_000,
// setupFiles: ['<rootDir>/test/helpers/init.js'],
// collectCoverageFrom: ['**/*.(t|j)s'],
collectCoverageFrom: ['<rootDir>/src/**/*.(t|j)s'],
coverageDirectory: '<rootDir>/coverage',
coverageReporters: [['lcov', { projectRoot: './' }], 'text'],
coveragePathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/test/',
'<rootDir>/dist/',
'<rootDir>/tmp/',
'<rootDir>/local_tests/',
'<rootDir>/coverage/',
'<rootDir>/src/utils/ui/',
'<rootDir>/src/client/',
],
coverageThreshold: {
global: {
statements: 82,
branches: 62,
functions: 77,
lines: 82,
},
},
};
export default config;