-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
35 lines (34 loc) · 1 KB
/
jest.config.ts
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
import type { Config } from '@jest/types';
export default {
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.ts',
// Svelte coverage is funky until mihar-22/svelte-jester #33 is fixed
// 'src/**/*.svelte'
],
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: ['src/types'],
coverageReporters: ['json', 'html', 'text'],
coverageThreshold: {
global: {
statements: -10,
branches: 90,
functions: 90,
lines: 90,
},
},
moduleFileExtensions: ['js', 'ts', 'svelte'],
moduleNameMapper: {
'\\.html$': '<rootDir>/__mocks__/htmlMock.ts',
},
preset: 'ts-jest',
roots: [process.cwd()],
setupFiles: ['mutationobserver-shim', './jest-setup/resize-observer.ts'],
setupFilesAfterEnv: ['./jest-setup/expect.ts', './jest-setup/vscode-api.ts'],
testEnvironment: 'jsdom',
testMatch: ['**/tests/**/*.test.ts'],
transform: {
'^.+\\.svelte$': ['svelte-jester', { preprocess: true }],
'^.+\\.ts$': 'ts-jest',
},
} as Config.InitialOptions;