forked from jonataswalker/ol-contextmenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
46 lines (43 loc) · 1.27 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
import { readFileSync } from 'fs';
const swcConfig = JSON.parse(readFileSync('./.swcrc', 'utf8'));
/** @type {import('jest').Config} */
const config = {
verbose: true,
moduleFileExtensions: ['js', 'json', 'ts'],
extensionsToTreatAsEsm: ['.ts'],
transformIgnorePatterns: [],
rootDir: '.',
testMatch: ['**/?(*.)+(spec).ts'],
// modulePathIgnorePatterns: ['<rootDir>/dist'],
moduleNameMapper: {
'^.+\\.(css|less|scss)$': 'identity-obj-proxy',
},
transform: {
'^.+\\.(t|j)s$': ['@swc/jest', { ...swcConfig }],
},
collectCoverage: true,
// coverageThreshold: {
// global: {
// branches: 50,
// functions: 20,
// lines: 60,
// statements: 60,
// },
// },
// collectCoverageFrom: ['src/**/*.ts', '!src/main.ts', '!src/**/*.module.(t|j)s'],
// coveragePathIgnorePatterns: [
// 'node_modules',
// 'dist',
// 'test-config',
// 'interfaces',
// 'jestGlobalMocks.ts',
// '.module.ts',
// '<rootDir>/src/main.ts',
// '.mock.ts',
// '.spec.ts',
// ],
// coverageDirectory: './coverage/unit',
// coverageReporters: ['json'],
testEnvironment: 'jsdom',
};
export default config;