-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
33 lines (29 loc) · 954 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
import { Config } from '@jest/types';
import dotenv from 'dotenv';
import { pathsToModuleNameMapper } from 'ts-jest';
import { compilerOptions } from './tsconfig.json';
dotenv.config();
const config: Config.InitialOptions = {
testEnvironment: 'node',
collectCoverageFrom: ['src/**/*.ts', '!src/**/__tests__/*.ts'],
projects: [
{
displayName: 'unit-tests',
testMatch: ['<rootDir>/src/**/*.test.ts'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
transform: {
'^.+\\.ts?$': 'ts-jest',
},
},
{
displayName: 'functional-tests',
testMatch: ['<rootDir>/tests/**/*.test.ts'],
testEnvironment: '<rootDir>/prisma/prisma-test-environment.ts',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
transform: {
'^.+\\.ts?$': 'ts-jest',
},
},
],
};
export default config;