|
1 | 1 | // For a detailed explanation regarding each configuration property, visit: |
2 | 2 | // https://jestjs.io/docs/en/configuration.html |
3 | 3 |
|
| 4 | +/** |
| 5 | + * @type {import('@jest/types').Config.InitialOptions} |
| 6 | + */ |
4 | 7 | module.exports = { |
5 | | - // All imported modules in your tests should be mocked automatically |
6 | | - // automock: false, |
7 | | - |
8 | | - // Stop running tests after the first failure |
9 | | - // bail: false, |
10 | | - |
11 | | - // Respect "browser" field in package.json when resolving modules |
12 | | - // browser: false, |
13 | | - |
14 | | - // The directory where Jest should store its cached dependency information |
15 | | - // cacheDirectory: "/var/folders/1n/hxkwxdt95zzgp53y_5ng4gy40000gn/T/jest_dx", |
16 | | - |
17 | | - // Automatically clear mock calls and instances between every test |
18 | | - clearMocks: true, |
19 | | - |
20 | | - // Indicates whether the coverage information should be collected while executing the test |
21 | | - // collectCoverage: false, |
22 | | - |
23 | | - // An array of glob patterns indicating a set of files for which coverage information should be collected |
24 | | - // collectCoverageFrom: null, |
25 | | - |
26 | | - // The directory where Jest should output its coverage files |
27 | | - coverageDirectory: 'coverage', |
28 | | - |
29 | | - // An array of regexp pattern strings used to skip coverage collection |
30 | | - // coveragePathIgnorePatterns: [ |
31 | | - // "/node_modules/" |
32 | | - // ], |
33 | | - |
34 | | - // A list of reporter names that Jest uses when writing coverage reports |
35 | | - // coverageReporters: [ |
36 | | - // "json", |
37 | | - // "text", |
38 | | - // "lcov", |
39 | | - // "clover" |
40 | | - // ], |
41 | | - |
42 | | - // An object that configures minimum threshold enforcement for coverage results |
43 | | - // coverageThreshold: null, |
44 | | - |
45 | | - // Make calling deprecated APIs throw helpful error messages |
46 | | - // errorOnDeprecated: false, |
47 | | - |
48 | | - // Force coverage collection from ignored files usin a array of glob patterns |
49 | | - // forceCoverageMatch: [], |
50 | | - |
51 | | - // A path to a module which exports an async function that is triggered once before all test suites |
52 | | - // globalSetup: null, |
53 | | - |
54 | | - // A path to a module which exports an async function that is triggered once after all test suites |
55 | | - // globalTeardown: null, |
56 | | - |
57 | | - // A set of global variables that need to be available in all test environments |
58 | | - globals: { |
59 | | - 'ts-jest': { |
60 | | - tsConfig: 'tsconfig.json', |
61 | | - }, |
62 | | - }, |
63 | | - |
64 | | - // An array of directory names to be searched recursively up from the requiring module's location |
65 | | - // moduleDirectories: [ |
66 | | - // "node_modules" |
67 | | - // ], |
68 | | - |
69 | | - // An array of file extensions your modules use |
70 | | - moduleFileExtensions: ['ts', 'tsx', 'js'], |
71 | | - |
72 | | - // A map from regular expressions to module names that allow to stub out resources with a single module |
73 | | - // moduleNameMapper: {}, |
74 | | - |
75 | | - // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader |
76 | | - // modulePathIgnorePatterns: [], |
77 | | - |
78 | | - // Activates notifications for test results |
79 | | - // notify: false, |
80 | | - |
81 | | - // An enum that specifies notification mode. Requires { notify: true } |
82 | | - // notifyMode: "always", |
83 | | - |
84 | | - // A preset that is used as a base for Jest's configuration |
85 | | - // preset: null, |
86 | | - |
87 | | - // Run tests from one or more projects |
88 | | - // projects: null, |
89 | | - |
90 | | - // Use this configuration option to add custom reporters to Jest |
91 | | - // reporters: undefined, |
92 | | - |
93 | | - // Automatically reset mock state between every test |
94 | | - // resetMocks: false, |
95 | | - |
96 | | - // Reset the module registry before running each individual test |
97 | | - // resetModules: false, |
98 | | - |
99 | | - // A path to a custom resolver |
100 | | - // resolver: null, |
101 | | - |
102 | | - // Automatically restore mock state between every test |
103 | | - // restoreMocks: false, |
104 | | - |
105 | | - // The root directory that Jest should scan for tests and modules within |
106 | | - // rootDir: null, |
107 | | - |
108 | | - // A list of paths to directories that Jest should use to search for files in |
109 | | - // roots: [ |
110 | | - // "<rootDir>" |
111 | | - // ], |
112 | | - |
113 | | - // Allows you to use a custom runner instead of Jest's default test runner |
114 | | - // runner: "jest-runner", |
115 | | - |
116 | | - // The paths to modules that run some code to configure or set up the testing environment before each test |
117 | | - // setupFiles: [], |
118 | | - |
119 | | - // The path to a module that runs some code to configure or set up the testing framework before each test |
120 | | - // setupTestFrameworkScriptFile: null, |
121 | | - |
122 | | - // A list of paths to snapshot serializer modules Jest should use for snapshot testing |
123 | | - // snapshotSerializers: [], |
124 | | - |
125 | | - // The test environment that will be used for testing |
126 | | - testEnvironment: 'node', |
127 | | - |
128 | | - // Options that will be passed to the testEnvironment |
129 | | - // testEnvironmentOptions: {}, |
130 | | - |
131 | | - // Adds a location field to test results |
132 | | - // testLocationInResults: false, |
133 | | - |
134 | | - // The glob patterns Jest uses to detect test files |
135 | | - testMatch: ['<rootDir>/test/**/*.test.+(ts|tsx|js)'], |
136 | | - |
137 | | - // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped |
138 | | - // testPathIgnorePatterns: [ |
139 | | - // "/node_modules/" |
140 | | - // ], |
141 | | - |
142 | | - // The regexp pattern Jest uses to detect test files |
143 | | - // testRegex: "", |
144 | | - |
145 | | - // This option allows the use of a custom results processor |
146 | | - // testResultsProcessor: null, |
147 | | - |
148 | | - // This option allows use of a custom test runner |
149 | | - // testRunner: "jasmine2", |
150 | | - |
151 | | - // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href |
152 | | - // testURL: "http://localhost", |
153 | | - |
154 | | - // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout" |
155 | | - // timers: "real", |
156 | | - |
157 | | - // A map from regular expressions to paths to transformers |
158 | | - transform: { |
159 | | - '^.+\\.(ts|tsx)$': 'ts-jest', |
160 | | - }, |
161 | | - |
162 | | - // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation |
163 | | - // transformIgnorePatterns: [ |
164 | | - // "/node_modules/" |
165 | | - // ], |
166 | | - |
167 | | - // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them |
168 | | - // unmockedModulePathPatterns: undefined, |
169 | | - |
170 | | - // Indicates whether each individual test should be reported during the run |
171 | | - // verbose: null, |
172 | | - |
173 | | - // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode |
174 | | - // watchPathIgnorePatterns: [], |
175 | | - |
176 | | - // Whether to use watchman for file crawling |
177 | | - // watchman: true, |
| 8 | + preset: 'ts-jest', |
178 | 9 | }; |
0 commit comments