generated from silver886/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
35 lines (34 loc) · 1.23 KB
/
jest.config.js
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
/* eslint-disable import/no-commonjs, import/unambiguous */
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
const {pathsToModuleNameMapper} = require('ts-jest');
// eslint-disable-next-line max-len
// eslint-disable-next-line import/extensions, @typescript-eslint/naming-convention, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
const {compilerOptions} = require('./tsconfig.json');
module.exports = {
preset: 'ts-jest',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {prefix: '<rootDir>/'}),
testEnvironment: 'node',
clearMocks: true,
collectCoverage: true,
coverageReporters: [
'json',
'lcov',
'clover',
'cobertura',
'text',
],
coverageDirectory: 'coverage',
testRegex: [
`${__dirname}(/src/(.*/)?__tests__/.*|/(test|src)/(.*/)?.*\\.(test|spec))\\.[jt]sx?$`,
],
coveragePathIgnorePatterns: [
'/node_modules/',
],
testPathIgnorePatterns: [
'/node_modules/',
],
watchPathIgnorePatterns: [
'/node_modules/',
],
};