-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
76 lines (62 loc) · 1.99 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
64
65
66
67
68
69
70
71
72
73
74
75
76
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
const path = require('path');
const { join } = require('path');
const artifactsPath = join(process.env.PROJECT_ROOT, '/build/artifacts');
module.exports = {
// The directory where Jest should store its cached dependency information
// cacheDirectory: "/private/var/folders/00/scx5qv4s0fzdh47cvtj6xrj80000gn/T/jest_dx",
// Automatically clear mock calls and instances between every test
clearMocks: true,
// The directory where Jest should output its coverage files
collectCoverage: true,
coverageDirectory: artifactsPath,
coverageReporters: [
'lcov',
'text',
'clover',
],
collectCoverageFrom: [
'src/**',
'!src/main.js',
'!src/scss/**',
'!src/vendor/**',
'!src/plugin/**',
],
// Fail testsuite if coverage is below given percentage
coverageThreshold: {
'./src/helper': {
statements: 85,
branches: 85,
functions: 85,
},
},
// Automatically reset mock state between every test
resetMocks: true,
// Automatically restore mock state between every test
restoreMocks: true,
// The root directory that Jest should scan for tests and modules within
rootDir: path.resolve(__dirname),
// This option allows the use of a custom resolver.
moduleNameMapper: {
'^src/(.*)$': '<rootDir>/src/$1',
},
reporters: [
'default',
['jest-junit', {
suiteName: 'Shopware 6 Storefront Unit Tests',
outputDirectory: artifactsPath,
outputName: 'storefront.junit.xml',
}],
],
// The glob patterns Jest uses to detect test files
testMatch: [
'!**/test/e2e/**',
'**/test/**/*.test.js',
'**/test/*.test.js',
],
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.html$': 'html-loader-jest',
},
};