-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.ts
44 lines (42 loc) · 1.19 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
36
37
38
39
40
41
42
43
44
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',
{
$schema: 'https://json.schemastore.org/swcrc',
jsc: {
parser: {
syntax: 'typescript',
tsx: false,
decorators: true,
},
keepClassNames: true,
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
},
sourceMaps: true,
},
],
},
collectCoverageFrom: [
'<rootDir>/src/**/*.(t|j)s',
'!<rootDir>/src/main.(t|J)s',
'!<rootDir>/src/**/*.dto.(t|J)s',
'!<rootDir>/src/**/*.module.(t|J)s',
'!<rootDir>/src/**/migrations/*',
'!<rootDir>/src/app/@common/**/config/swagger.config.ts',
'!<rootDir>/src/app/@common/**/documentations/**/*',
],
coverageDirectory: 'coverage',
testEnvironment: 'node',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>',
}),
} as Config.InitialOptions;