-
Notifications
You must be signed in to change notification settings - Fork 9
/
jest.config.ts
35 lines (32 loc) · 988 Bytes
/
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
import type { Config } from 'jest';
// https://kulshekhar.github.io/ts-jest/docs/guides/esm-support/
import { createDefaultEsmPreset } from 'ts-jest';
const defaultEsmPreset = createDefaultEsmPreset();
// https://kulshekhar.github.io/ts-jest/docs/guides/esm-support/
const config: Config = {
testEnvironment: 'node',
testMatch: ['<rootDir>/test/**/*-test.ts'],
setupFiles: ['<rootDir>/test/jest.setup.cjs'],
...defaultEsmPreset,
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'#(.*)': '<rootDir>/node_modules/$1',
},
coveragePathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/test/',
// these files are created by the test suite in the in-memory fs,
// which test has access to and so counts in coverage by default
'<rootDir>/index.js',
'<rootDir>/index-foo.js',
],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
};
export default config;