-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathjest.config.js
More file actions
28 lines (26 loc) · 828 Bytes
/
jest.config.js
File metadata and controls
28 lines (26 loc) · 828 Bytes
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
import { VERSION as SVELTE_VERSION } from 'svelte/compiler'
const SVELTE_TRANSFORM_PATTERN =
SVELTE_VERSION >= '5'
? String.raw`^.+\.svelte(?:\.js)?$`
: String.raw`^.+\.svelte$`
export default {
testMatch: ['<rootDir>/tests/**/*.test.js'],
transform: {
[SVELTE_TRANSFORM_PATTERN]: 'svelte-jester',
},
moduleFileExtensions: ['js', 'svelte'],
extensionsToTreatAsEsm: ['.svelte'],
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/tests/_jest-setup.js'],
injectGlobals: true,
moduleNameMapper: {
'^vitest$': '<rootDir>/tests/_jest-vitest-alias.js',
},
resetMocks: true,
restoreMocks: true,
collectCoverageFrom: ['<rootDir>/packages/*/src/**/*'],
coveragePathIgnorePatterns: [
'<rootDir>/packages/svelte/src/vite.js',
'<rootDir>/packages/svelte/src/vitest.js',
],
}