1
- /*
1
+ /**
2
2
* For a detailed explanation regarding each configuration property, visit:
3
3
* https://jestjs.io/docs/configuration
4
4
*/
5
5
6
- module . exports = {
6
+ /** @type {import('jest').Config } */
7
+ const config = {
7
8
// All imported modules in your tests should be mocked automatically
8
9
// automock: false,
9
10
10
11
// Stop running tests after `n` failures
11
12
// bail: 0,
12
13
13
14
// The directory where Jest should store its cached dependency information
14
- // cacheDirectory: "/private/var/folders/81/m6w95r0j7ms_10c47hdbz4gw0000gn/T/jest_dx ",
15
+ // cacheDirectory: "/tmp/jest_rs ",
15
16
16
- // Automatically clear mock calls, instances and results before every test
17
+ // Automatically clear mock calls, instances, contexts and results before every test
17
18
clearMocks : true ,
18
19
19
20
// Indicates whether the coverage information should be collected while executing the test
20
- // collectCoverage: false ,
21
+ collectCoverage : true ,
21
22
22
23
// An array of glob patterns indicating a set of files for which coverage information should be collected
23
24
// collectCoverageFrom: undefined,
24
25
25
26
// The directory where Jest should output its coverage files
26
- // coverageDirectory: undefined ,
27
+ coverageDirectory : "coverage" ,
27
28
28
29
// An array of regexp pattern strings used to skip coverage collection
29
- // coveragePathIgnorePatterns: [
30
- // "/node_modules/"
31
- // ],
30
+ coveragePathIgnorePatterns : [
31
+ "/node_modules/" ,
32
+ "/tests/fixtures/" ,
33
+ ] ,
32
34
33
35
// Indicates which provider should be used to instrument code for coverage
34
36
// coverageProvider: "babel",
@@ -50,6 +52,11 @@ module.exports = {
50
52
// Make calling deprecated APIs throw helpful error messages
51
53
// errorOnDeprecated: false,
52
54
55
+ // The default configuration for fake timers
56
+ // fakeTimers: {
57
+ // "enableGlobally": false
58
+ // },
59
+
53
60
// Force coverage collection from ignored files using an array of glob patterns
54
61
// forceCoverageMatch: [],
55
62
@@ -73,6 +80,8 @@ module.exports = {
73
80
// An array of file extensions your modules use
74
81
// moduleFileExtensions: [
75
82
// "js",
83
+ // "mjs",
84
+ // "cjs",
76
85
// "jsx",
77
86
// "ts",
78
87
// "tsx",
@@ -137,7 +146,7 @@ module.exports = {
137
146
// snapshotSerializers: [],
138
147
139
148
// The test environment that will be used for testing
140
- // testEnvironment: "jest-environment-node ",
149
+ testEnvironment : "jsdom " ,
141
150
142
151
// Options that will be passed to the testEnvironment
143
152
// testEnvironmentOptions: {},
@@ -165,14 +174,10 @@ module.exports = {
165
174
// This option allows use of a custom test runner
166
175
// testRunner: "jest-circus/runner",
167
176
168
- // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
169
- // testURL: "http://localhost",
170
-
171
- // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
172
- // timers: "real",
173
-
174
177
// A map from regular expressions to paths to transformers
175
- // transform: undefined,
178
+ transform : {
179
+ "^.+\\.jsx?$" : "babel-jest" ,
180
+ } ,
176
181
177
182
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
178
183
// transformIgnorePatterns: [
@@ -192,3 +197,5 @@ module.exports = {
192
197
// Whether to use watchman for file crawling
193
198
// watchman: true,
194
199
} ;
200
+
201
+ module . exports = config ;
0 commit comments