-
Notifications
You must be signed in to change notification settings - Fork 27
/
jest.config.js
61 lines (60 loc) · 1.26 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
const common = {
testEnvironment: 'node',
clearMocks: true,
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.js'],
transformIgnorePatterns: ['/node_modules/(?!@digitalbazaar|base.+-universal|crypto-ld)'],
transform: {
"\\.js$": ["babel-jest", { root: './' }],
"\\.ts$": "ts-jest"
},
resolver: "ts-jest-resolver",
moduleDirectories: [
"node_modules",
"packages/*/src"
],
coverageDirectory: 'coverage',
coverageThreshold: {
global: {
branches: 50,
functions: 50,
lines: 50,
statements: 50,
},
},
collectCoverageFrom: [
'packages/*/src/**',
],
coveragePathIgnorePatterns: [
// test and library code
'/node_modules/',
'/lib/',
'/tests/',
// not properly testable
'packages/types/',
'index.ts',
'types.ts',
'.chain.ts',
'DelegationDecoder.ts',
'SDKErrors.ts',
'Did.rpc.ts',
// third party code copied to this repo
'packages/utils/src/json-schema/',
'jsonabc.ts',
],
}
module.exports = {
...common,
testTimeout: 5000,
projects: [
{
...common,
displayName: 'unit',
roots: ['<rootDir>/packages'],
},
{
...common,
displayName: 'breaking',
roots: ['<rootDir>/tests/breakingChanges'],
},
]
}