-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
60 lines (44 loc) · 1.75 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
49
50
51
52
53
54
55
56
57
58
59
60
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
import type { Config } from 'jest';
import { pathsToModuleNameMapper } from 'ts-jest';
import { compilerOptions } from './tsconfig.json';
const config: Config = {
// An array of file extensions your modules use
moduleFileExtensions: [
"js",
"ts",
"json",
],
// modulePaths: [compilerOptions.baseUrl],
// @see https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping/
// 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>/' } ),
// The root directory that Jest should scan for tests and modules within
// rootDir: "src",
// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: [],
// The test environment that will be used for testing
"testEnvironment": "node",
// The glob patterns Jest uses to detect test files
testMatch: [
"**/__test__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[tj]s?(x)"
],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: [
"/node_modules/", "example/", "dist/"
],
// The regexp pattern or array of patterns that Jest uses to detect test files
// "testRegex": ".*\\.spec\\.ts$",
// A map from regular expressions to paths to transformers
transform: {
"^.+\\.(t|j)s$": "ts-jest"
},
// Indicates whether each individual test should be reported during the run
verbose: false,
silent: false,
};
export default config;