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