-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
48 lines (47 loc) · 1.27 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
47
48
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig.lib');
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.spec.json',
},
],
},
collectCoverage: true,
// on node 14.x coverage provider v8 offers good speed and more or less good report
coverageProvider: 'v8',
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/types.ts',
'!**/tests/**',
'!**/node_modules/**',
'!<rootDir>/out/**',
'!<rootDir>/examples/**',
'!<rootDir>/website/**',
'!<rootDir>/.next/**',
'!<rootDir>/*.config.js',
'!<rootDir>/coverage/**',
'!<rootDir>/dist/**',
'!<rootDir>/artifacts/**',
'!<rootDir>/out/**',
],
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: [
'<rootDir>/artifacts/',
'<rootDir>/dist/',
'<rootDir>/out/',
'<rootDir>/coverage/',
'<rootDir>/examples/',
'<rootDir>/website/',
'<rootDir>/node_modules/',
],
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
setupFilesAfterEnv: ['<rootDir>/tests/react/setup.ts'],
};