forked from MetaMask/metamask-extension
-
Notifications
You must be signed in to change notification settings - Fork 6
/
jest.config.js
68 lines (68 loc) · 2.12 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
module.exports = {
collectCoverageFrom: [
'<rootDir>/app/scripts/controllers/permissions/**/*.js',
'<rootDir>/app/scripts/lib/createRPCMethodTrackingMiddleware.js',
'<rootDir>/shared/**/*.js',
'<rootDir>/ui/**/*.js',
],
coverageDirectory: './jest-coverage/main',
coveragePathIgnorePatterns: ['.stories.js', '.snap'],
coverageReporters: ['html', 'text-summary', 'json-summary'],
coverageThreshold: {
global: {
branches: 44,
functions: 46,
lines: 52,
statements: 52,
},
'./app/scripts/controllers/permissions/**/*.js': {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
'./app/scripts/lib/createRPCMethodTrackingMiddleware.js': {
branches: 95.65,
functions: 100,
lines: 100,
statements: 100,
},
},
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: 'test/test-results/',
outputName: 'junit.xml',
},
],
],
// TODO: enable resetMocks
// resetMocks: true,
restoreMocks: true,
setupFiles: ['<rootDir>/test/setup.js', '<rootDir>/test/env.js'],
setupFilesAfterEnv: ['<rootDir>/test/jest/setup.js'],
testMatch: [
'<rootDir>/ui/**/*.test.js',
'<rootDir>/shared/**/*.test.js',
'<rootDir>/app/scripts/lib/**/*.test.js',
'<rootDir>/app/scripts/migrations/*.test.js',
'<rootDir>/app/scripts/platforms/*.test.js',
'<rootDir>/app/scripts/controllers/network/**/*.test.js',
'<rootDir>/app/scripts/controllers/permissions/**/*.test.js',
'<rootDir>/app/scripts/flask/**/*.test.js',
'<rootDir>/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js',
'<rootDir>/app/scripts/constants/error-utils.test.js',
],
testTimeout: 2500,
// We have to specify the environment we are running in, which is jsdom. The
// default is 'node'. This can be modified *per file* using a comment at the
// head of the file. So it may be worthwhile to switch to 'node' in any
// background tests.
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
},
workerIdleMemoryLimit: '500MB',
};