-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
36 lines (36 loc) · 1.1 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
const testPathRE = /(^\/packages\/[^\/]+\/|\.spec|\/__tests?__)/g;
const testPathToFilePath = filepath => filepath.replace(testPathRE, '');
module.exports = {
projects: [
'packages/peregrine',
'packages/pwa-buildpack',
'packages/upward-js',
'packages/venia-concept',
'scripts'
],
collectCoverage: true,
collectCoverageFrom: [
'scripts/**/*.js',
'src/**/*.js',
'lib/**/*.js',
'!**/__stories__/**',
'!**/__helpers__/**'
],
reporters: [
'default',
[
'jest-junit',
{
suiteName: 'Jest unit and functional tests',
output: './test-results/jest/results.xml',
suiteNameTemplate: ({ displayName, filepath }) =>
`${displayName}: ${testPathToFilePath(
testPathToFilePath(filepath)
)}`,
classNameTemplate: ({ classname, title }) =>
classname !== title ? classname : '',
titleTemplate: '{title}'
}
]
]
};