forked from webdriverio/webdriverio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
63 lines (60 loc) · 1.59 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
const testPathIgnorePatterns = [
'<rootDir>/tests/',
'<rootDir>/node_modules/'
]
const coveragePathIgnorePatterns = [
'node_modules/',
'packages/devtools/src/scripts',
'packages/devtools/src/commands',
'packages/webdriverio/src/scripts',
'packages/wdio-devtools-service/src/scripts',
'packages/webdriverio/build',
'packages/webdriver/build',
'packages/wdio-cucumber-framework/tests/fixtures',
'packages/wdio-logger/build',
'packages/wdio-webdriver-mock-service',
'packages/wdio-smoke-test-reporter',
'packages/wdio-smoke-test-service'
]
/**
* check Node.js version and ignore `@wdio/sync` test if we
* are on v16 or higher
*/
const [major] = process.versions.node.split('.')
if (parseInt(major) >= 16) {
testPathIgnorePatterns.push('<rootDir>/packages/wdio-sync')
coveragePathIgnorePatterns.push('/packages/wdio-sync')
}
module.exports = {
globals: {
'ts-jest': {
isolatedModules: true
}
},
testMatch: [
'**/tests/**/*.test.(js|ts)'
],
transform: {
'^.+\\.(ts|js)$': 'ts-jest'
},
testPathIgnorePatterns,
collectCoverageFrom: [
'packages/**/src/**/*.(js|ts)',
'!packages/**/src/**/*.d.ts'
],
moduleNameMapper: {
'graceful-fs': '<rootDir>/tests/helpers/fs.js'
},
coverageDirectory: './coverage/',
collectCoverage: true,
coverageThreshold: {
global: {
branches: 89,
functions: 94,
lines: 95,
statements: 95
}
},
testEnvironment: 'node',
coveragePathIgnorePatterns
}