-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
32 lines (30 loc) · 1.06 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
import { pathsToModuleNameMapper } from 'ts-jest';
import { Config } from 'jest';
import { compilerOptions } from './tsconfig.json';
const config: Config = {
setupFiles: ['dotenv/config'],
globalSetup: '<rootDir>/test/globalSetup.ts',
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['<rootDir>/src/config/', '<rootDir>/node_modules/', '<rootDir>/dist/', '<rootDir>/coverage/'],
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
roots: ['<rootDir>'],
moduleFileExtensions: ['ts', 'js'],
moduleDirectories: ['node_modules', '<rootDir>'],
reporters: [
[
'default',
{
collectCoverage: true,
collectCoverageFrom: ['**/*.ts'],
coverageDirectory: 'coverage',
coverageReporters: ['json', 'lcov', 'text-summary']
}
]
],
clearMocks: true,
resetMocks: true,
collectCoverageFrom: ['**/*.ts', '!jest.config.ts', '!**/src/config/**', '!**/__tests__/**', '!**/node_modules/**', '!**/coverage/**', '!test/**']
};
export default config;