-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
48 lines (34 loc) · 1.59 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
38
39
40
41
42
43
44
45
46
47
48
import type { Config } from 'jest';
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/
const jestConfig: Config = {
// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: ['index.ts', 'src/**/*.{js,ts}', '!src/**/*.d.ts'],
// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
// An array of directory names to be searched recursively up from the requiring module's location
moduleDirectories: ['<rootDir>', 'node_modules'],
// An alternative API to setting the NODE_PATH env variable,
// modulePaths is an array of absolute paths to additional locations to search when resolving modules.
modulePaths: ['<rootDir>/node_modules'],
// An array of file extensions your modules use
// Module file extensions for importing
moduleFileExtensions: ['ts', 'js'],
// Automatically restore mock state before every test
restoreMocks: true,
// A list of paths to modules that run some code to configure or set up the testing environment.
setupFiles: ['./jest.setup.ts'],
// The test environment that will be used for testing
testEnvironment: 'node',
moduleNameMapper: {},
// The glob patterns Jest uses to detect test files
testMatch: ['<rootDir>/**/*.spec.{js,ts}'],
preset: 'ts-jest',
// Those file will not be transformed
transformIgnorePatterns: [],
// Indicates whether each individual test should be reported during the run
verbose: true,
};
export default jestConfig;