-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
44 lines (42 loc) · 1.46 KB
/
jest.config.js
File metadata and controls
44 lines (42 loc) · 1.46 KB
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
const swcConfig = {
swcrc: false,
jsc: {
loose: true,
parser: { syntax: 'typescript', decorators: true },
transform: { legacyDecorator: true, decoratorMetadata: true },
keepClassNames: true,
},
sourceMaps: 'inline',
inlineSourcesContent: false,
module: { type: 'commonjs', ignoreDynamic: true },
}
/** @type {import('jest').Config} */
const config = {
projects: [
{
displayName: 'unit',
testEnvironment: 'node',
testMatch: ['<rootDir>/src/**/*.test.(j|t)s', '<rootDir>/src/**/*.spec.(j|t)s'],
testPathIgnorePatterns: ['\\.integration\\.(spec|test)\\.(j|t)s$', '__fixtures__'],
modulePathIgnorePatterns: ['<rootDir>/dist'],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest', swcConfig],
},
collectCoverageFrom: ['<rootDir>/src/**/*.(t|j)s', '!**/*.spec.ts', '!**/*.test.ts', '!**/__tests__/**'],
},
{
displayName: 'integration',
testEnvironment: 'node',
testMatch: ['<rootDir>/src/**/*.integration.spec.(j|t)s', '<rootDir>/src/**/*.integration.test.(j|t)s', '<rootDir>/test/integration/**/*.test.(j|t)s', '<rootDir>/test/integration/**/*.spec.(j|t)s'],
testPathIgnorePatterns: ['__fixtures__'],
modulePathIgnorePatterns: ['<rootDir>/dist'],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest', swcConfig],
},
},
],
coverageDirectory: '<rootDir>/coverage',
coverageReporters: ['lcovonly'],
testLocationInResults: true,
}
module.exports = config