-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.cjs
27 lines (27 loc) · 910 Bytes
/
jest.config.cjs
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
module.exports = {
testEnvironment: 'jsdom',
transform: {
'^.+\\.js$': 'ts-jest',
'^.+\\.svelte$': [
'svelte-jester',
{
preprocess: './svelte.config.test.cjs'
}
],
'^.+\\.ts$': 'ts-jest'
},
moduleFileExtensions: ['js', 'ts', 'svelte'],
moduleNameMapper: {
'^\\$lib(.*)$': '<rootDir>/src/lib$1',
'^\\$app(.*)$': [
'<rootDir>/.svelte-kit/dev/runtime/app$1',
'<rootDir>/.svelte-kit/build/runtime/app$1'
]
},
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
// Set collectCoverage to false for now since setting this to true gives an [ERR_IVALID_ARG_TYPE] error.
// This is a known issue: https://github.com/mihar-22/svelte-jester/issues/72
// As a workaround for now, run `yarn test --watch --coverage` to see coverage report.
collectCoverage: false,
collectCoverageFrom: ['src/**/*.{ts,svelte}', '!**/node_modules/**']
};