-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest-preset.js
37 lines (31 loc) · 914 Bytes
/
jest-preset.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
const path = require('path');
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
testEnvironment: 'jsdom',
// booleans
clearMocks: true,
resetMocks: true,
/**
* TODO: understand why setting resetModules: true doesn't generate any
* 'v8' coverage for packages
*/
resetModules: true,
// file extensions and test paths
testMatch: ['**/*.test.[jt]s?(x)'],
// transform paths and module name mapper
transform: {
'^.+\\.jsx?$': ['babel-jest', { rootMode: 'upward' }],
},
// coverage
collectCoverage: true,
collectCoverageFrom: ['**/*.{js,ts,tsx,jsx}'],
coveragePathIgnorePatterns: [
'/node_modules/',
'/coverage/',
'jest.config.js',
'jest-preset.js',
'babel.config.js',
],
coverageProvider: 'v8',
coverageReporters: ['json', 'html', 'text', 'lcov']
};