forked from nocobase/nocobase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
46 lines (42 loc) · 1.06 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
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig.paths.json');
const swcrc = {
jsc: {
parser: {
syntax: 'typescript',
tsx: false,
decorators: true,
dynamicImport: false,
},
},
};
((swcrc.jsc ??= {}).experimental ??= {}).plugins = [['jest_workaround', {}]];
const config = {
rootDir: process.cwd(),
collectCoverage: false,
verbose: true,
preset: 'ts-jest',
testMatch: ['**/__tests__/**/*.test.[jt]s'],
setupFiles: ['./jest.setup.ts'],
setupFilesAfterEnv: ['./jest.setupAfterEnv.ts'],
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/',
}),
},
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest', swcrc],
},
modulePathIgnorePatterns: ['/esm/', '/es/', '/dist/', '/lib/', '/client/', '/sdk/', '\\.test\\.tsx$'],
coveragePathIgnorePatterns: [
'/node_modules/',
'/__tests__/',
'/esm/',
'/lib/',
'package.json',
'/demo/',
'package-lock.json',
'/storage/',
],
};
module.exports = config;