generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
43 lines (34 loc) · 1.2 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
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/
const merge = require('deepmerge');
const path = require('path');
const baseConfig = require('../../jest.config.packages');
const displayName = path.basename(__dirname);
module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,
// Add coverage ignore patterns
coveragePathIgnorePatterns: [
'index.ts',
'.d.ts',
'src/components/icon/icons/', // Auto-generated icons
'scripts/create-component/ComponentName/', // component template
],
// Add test match ignore patterns
testPathIgnorePatterns: ['scripts/create-component/ComponentName/'],
// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
// Include setup file that configures testing utilities like @testing-library/react
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
// Use jsdom environment to simulate a browser-like DOM for testing React components
testEnvironment: 'jsdom',
});