-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
37 lines (33 loc) · 1.2 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
import { pathsToModuleNameMapper } from 'ts-jest'
import type { JestConfigWithTsJest } from 'ts-jest'
const jestConfig: JestConfigWithTsJest = {
clearMocks: true,
preset: 'ts-jest',
testEnvironment: '@quramy/jest-prisma/environment',
coverageProvider: 'babel',
moduleFileExtensions: ['js', 'ts'],
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!<rootDir>/src/main.ts',
'!<rootDir>/src/config/envs.ts',
'!<rootDir>/src/database/client.ts'
],
moduleNameMapper: pathsToModuleNameMapper(
{
'@database/*': ['database/*'],
'@helpers/*': ['helpers/*'],
'@config/*': ['config/*'],
'@repositories/*': ['data/repositories/*'],
'@controllers/*': ['data/controllers/*'],
'@validators/*': ['data/validators/*'],
'@services/*': ['data/services/*'],
'@factories/*': ['data/factories/*'],
'@utils/*': ['utils/*']
},
{ prefix: '<rootDir>/src/' }
),
setupFilesAfterEnv: ['<rootDir>/tests/mock-prisma.ts'],
testMatch: ['<rootDir>/tests/**/*.test.ts', '<rootDir>/tests/**/*.spec.ts'],
testTimeout: 180000
}
export default jestConfig