-
Notifications
You must be signed in to change notification settings - Fork 28
/
jest.config.ts
40 lines (38 loc) · 986 Bytes
/
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
36
37
38
39
40
import type { Config } from '@jest/types';
import { pathsToModuleNameMapper } from 'ts-jest';
import { compilerOptions } from './tsconfig.json';
export default {
moduleFileExtensions: ['js', 'json', 'ts'],
testRegex: '.*\\.spec\\.ts$',
transform: {
'^.+\\.(t|j)s$': [
'@swc/jest',
{
jsc: {
parser: {
syntax: 'typescript',
tsx: false,
decorators: true,
},
target: 'es2017',
keepClassNames: true,
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
},
module: {
type: 'es6',
noInterop: false,
},
},
],
},
collectCoverageFrom: ['<rootDir>/src/**/*.(t|j)s'],
coverageDirectory: 'coverage',
testEnvironment: 'node',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>',
}),
preset: 'ts-jest',
} as Config.InitialOptions;