forked from enzymefinance/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
87 lines (81 loc) · 2.09 KB
/
jest.config.ts
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import 'dotenv/config';
import { utils } from 'ethers';
const mnemonic = 'test test test test test test test test test test test junk';
function common(name: string, roots: string[]) {
return {
displayName: name,
roots,
globals: {
'ts-jest': {
babelConfig: true,
diagnostics: false,
},
},
};
}
function fork(name: string, roots: string[]) {
return {
...common(name, roots),
preset: '@crestproject/jest',
testEnvironmentOptions: {
hardhatNetworkOptions: {
// loggingEnabled: true,
gas: 9500000,
accounts: {
mnemonic,
count: 5,
accountsBalance: utils.parseUnits('1', 36).toString(),
},
...(process.env.COVERAGE && {
allowUnlimitedContractSize: true,
}),
},
hardhatTestOptions: {
...(process.env.COVERAGE && {
coverage: true,
}),
},
},
};
}
function unit(name: string, roots: string[]) {
return {
...common(name, roots),
preset: '@crestproject/hardhat',
testEnvironmentOptions: {
hardhatNetworkOptions: {
// loggingEnabled: true,
gas: 9500000,
accounts: {
mnemonic,
count: 10,
accountsBalance: utils.parseUnits('1', 36).toString(),
},
forking: {
enabled: false,
},
...(process.env.COVERAGE && {
allowUnlimitedContractSize: true,
}),
},
hardhatTestOptions: {
...(process.env.COVERAGE && {
coverage: true,
}),
},
},
};
}
const projects = [
unit('core', ['tests/release/core', 'tests/persistent', 'tests/mocks']),
unit('infrastructure', ['tests/release/infrastructure']),
unit('policy', ['tests/release/extensions/policy-manager']),
unit('integration', ['tests/release/extensions/integration-manager']),
unit('fee', ['tests/release/extensions/fee-manager']),
unit('peripheral', ['tests/release/peripheral']),
fork('e2e', ['tests/release/e2e']),
].filter((project) => !!project);
module.exports = {
testTimeout: 240000,
projects,
};