-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathjest.config.js
48 lines (46 loc) · 1.42 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
module.exports = {
collectCoverageFrom: ['./src/**/*.ts'],
// Configure jest-junit reporter on CI. Otherwise use only default reporter
reporters: [
'default',
...(Boolean(process.env.CI)
? [
[
'jest-junit',
{
outputDirectory: './reports',
outputName: 'junit.xml',
classNameTemplate: '{classname}',
titleTemplate: '{title}',
ancestorSeparator: ' ',
suiteNameTemplate: '{filename}',
},
],
]
: []),
],
projects: [
{
displayName: 'unit',
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['test/unit'],
clearMocks: true,
},
{
displayName: 'int',
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['test/integration'],
globalSetup: './test/integration/test-helpers/global-setup.ts',
globalTeardown:
'./test/integration/test-helpers/global-teardown.ts',
globals: {
'ts-jest': {
tsConfig: 'test/integration/tsconfig.json',
},
},
restoreMocks: true,
},
],
};