forked from vuestorefront/shopware-pwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
41 lines (37 loc) · 1.23 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
const lernaJson = require("./lerna.json");
const e2e = require("minimist")(process.argv.slice(2))["e2e"];
const isUnitTest = e2e !== "true";
console.log(`Starting ${isUnitTest ? "unit" : "e2e"} tests...`);
const UNIT_TEST_PATTERNS = [
"<rootDir>/packages/**/__tests__/**/*spec.[jt]s?(x)"
];
const E2E_TEST_PATTERNS = ["<rootDir>/packages/**/__e2e__/**/*spec.[jt]s?(x)"];
module.exports = {
preset: "ts-jest",
globals: {
__DEV__: true,
__VERSION__: lernaJson.version,
__BROWSER__: false,
__JSDOM__: true,
__FEATURE_OPTIONS__: true,
__FEATURE_SUSPENSE__: true
},
collectCoverage: isUnitTest,
coverageDirectory: "coverage",
coverageReporters: ["html", "lcov", "text"],
collectCoverageFrom: [
"packages/*/src/**/*.ts",
"!packages/default-template/**",
"!packages/cli/**",
"!**/interfaces/**"
],
watchPathIgnorePatterns: ["/node_modules/"],
moduleFileExtensions: ["ts", "tsx", "js", "json"],
moduleNameMapper: {
"^@shopware-pwa/(.*?)/src$": "<rootDir>/packages/$1/src",
"^@shopware-pwa/(.*?)/src/(.*?)$": "<rootDir>/packages/$1/src/$2",
"^@shopware-pwa/(.*?)$": "<rootDir>/packages/$1/src"
},
rootDir: __dirname,
testMatch: isUnitTest ? UNIT_TEST_PATTERNS : E2E_TEST_PATTERNS
};