-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
48 lines (47 loc) · 1.02 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 = {
"transform": {
"^.+\\.(js|mjs)$": "babel-jest",
"^.+\\.ts$": "ts-jest",
"^.+\\.svelte$": [
"svelte-jester",
{
"preprocess": true
}
]
},
"moduleFileExtensions": [
"js",
"mjs",
"ts",
"svelte"
],
"coverageDirectory": ".coverage",
"coverageReporters": ["json", "lcov", "text", "clover", "html"],
"collectCoverageFrom": [
"src/**/*.js",
"src/**/*.svelte",
"src/**/*.ts"
],
"coverageProvider": "babel",
"coveragePathIgnorePatterns": [
".*\\.d\\.ts",
"main.ts"
],
transformIgnorePatterns: [
ignoreModules([
'svelte-spa-router',
'regexparam',
'svelte-scrollto'
])
],
moduleNameMapper: {
"^regexparam$": "<rootDir>/node_modules/regexparam/dist/regexparam.mjs",
},
"bail": 1,
"verbose": true,
"setupFiles": ["./jest.setup.js"],
setupFilesAfterEnv: ["@testing-library/jest-dom/extend-expect"]
};
function ignoreModules(modules) {
return `node_modules/(?!(${modules.join('|')})/)`
}