-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.cjs
34 lines (32 loc) · 1.18 KB
/
jest.config.cjs
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
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/
const ignorePatterns = ['/node_modules/', '/\\.', '/_', '/index\\.tsx?$', '\\.d\\.ts$'];
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
bail: 0,
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
coverageDirectory: 'out/coverage',
coveragePathIgnorePatterns: ignorePatterns,
coverageProvider: 'v8',
coverageReporters: ['text-summary', 'html-spa', 'lcov'],
coverageThreshold: { global: { branches: 50, functions: 50, lines: 50, statements: 50 } },
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
'\\.css$': 'identity-obj-proxy',
// Remove the .js extension (required for ES Module support) from TS file imports.
'^(\\.{1,2}/.*)\\.jsx?$': '$1',
},
restoreMocks: true,
roots: ['src'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
testEnvironment: 'jsdom',
testPathIgnorePatterns: ignorePatterns,
transform: {
'^.+\\.[tj]sx?$': ['ts-jest', { diagnostics: { ignoreCodes: [151001] }, useESM: true }],
},
// transformIgnorePatterns: [],
verbose: true,
};