-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
41 lines (39 loc) · 1.01 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
require('dotenv/config');
const isCI = process.env.CI === 'true';
module.exports = {
verbose: true,
collectCoverage: false,
resetModules: true,
restoreMocks: true,
testEnvironment: 'node',
transform: {
'^.+\\\\\\\\.tsx?$': 'ts-jest',
},
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts'],
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
// testMatch: ['<rootDir>/src/platforms/npm-package/index.spec.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
globals: {
'ts-jest': {
tsconfig: './tsconfig.test.json',
useESM: true,
},
__JEST_TEST_ENV__: true,
},
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
coveragePathIgnorePatterns: [
'<rootDir>/dist/',
'/node_modules/',
'<rootDir>/scripts',
'<rootDir>/tools',
'<rootDir>/src/types.ts',
'<rootDir>/src/globals.d.ts',
],
coverageProvider: 'v8',
coverageReporters: isCI ? ['json'] : ['text'],
testTimeout: 60 * 1000,
setupFiles: ['./jest-global-mock.ts'],
};