-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
32 lines (23 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
/* eslint-disable import/no-extraneous-dependencies */
import { Config } from 'jest';
import { pathsToModuleNameMapper } from 'ts-jest';
import { compilerOptions } from './tsconfig.json';
const config: Config = {
// Stop running tests after `n` failures
bail: true,
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,
// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'v8',
// A preset that is used as a base for Jest's configuration
preset: 'ts-jest',
// The glob patterns Jest uses to detect test files
testMatch: ['**/*.spec.ts'],
// The paths to modules that run some code to configure or set up the testing environment before each test
setupFiles: ['<rootDir>/.jest/setEnvVars.ts'],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/src/',
}),
};
export default config;