@@ -115,117 +115,120 @@ export type DisplayName =
115
115
color : DisplayNameColor ;
116
116
} ;
117
117
118
- export type InitialOptions = {
119
- automock ?: boolean ;
120
- bail ?: boolean | number ;
121
- browser ?: boolean ;
122
- cache ?: boolean ;
123
- cacheDirectory ?: Path ;
124
- clearMocks ?: boolean ;
125
- changedFilesWithAncestor ?: boolean ;
126
- changedSince ?: string ;
127
- collectCoverage ?: boolean ;
128
- collectCoverageFrom ?: Array < Glob > ;
129
- collectCoverageOnlyFrom ?: {
118
+ export type InitialOptionsWithRootDir = InitialOptions &
119
+ Required < Pick < InitialOptions , 'rootDir' > > ;
120
+
121
+ export type InitialOptions = Partial < {
122
+ automock : boolean ;
123
+ bail : boolean | number ;
124
+ browser : boolean ;
125
+ cache : boolean ;
126
+ cacheDirectory : Path ;
127
+ clearMocks : boolean ;
128
+ changedFilesWithAncestor : boolean ;
129
+ changedSince : string ;
130
+ collectCoverage : boolean ;
131
+ collectCoverageFrom : Array < Glob > ;
132
+ collectCoverageOnlyFrom : {
130
133
[ key : string ] : boolean ;
131
134
} ;
132
- coverageDirectory ? : string ;
133
- coveragePathIgnorePatterns ? : Array < string > ;
134
- coverageReporters ? : Array < string > ;
135
- coverageThreshold ? : {
135
+ coverageDirectory : string ;
136
+ coveragePathIgnorePatterns : Array < string > ;
137
+ coverageReporters : Array < string > ;
138
+ coverageThreshold : {
136
139
global : {
137
140
[ key : string ] : number ;
138
141
} ;
139
142
} ;
140
- dependencyExtractor ? : string ;
141
- detectLeaks ? : boolean ;
142
- detectOpenHandles ? : boolean ;
143
- displayName ? : DisplayName ;
144
- expand ? : boolean ;
145
- extraGlobals ? : Array < string > ;
146
- filter ? : Path ;
147
- findRelatedTests ? : boolean ;
148
- forceCoverageMatch ? : Array < Glob > ;
149
- forceExit ? : boolean ;
150
- json ? : boolean ;
151
- globals ? : ConfigGlobals ;
152
- globalSetup ? : string | null | undefined ;
153
- globalTeardown ? : string | null | undefined ;
154
- haste ? : HasteConfig ;
155
- reporters ? : Array < string | ReporterConfig > ;
156
- logHeapUsage ? : boolean ;
157
- lastCommit ? : boolean ;
158
- listTests ? : boolean ;
159
- mapCoverage ? : boolean ;
160
- maxConcurrency ? : number ;
143
+ dependencyExtractor : string ;
144
+ detectLeaks : boolean ;
145
+ detectOpenHandles : boolean ;
146
+ displayName : DisplayName ;
147
+ expand : boolean ;
148
+ extraGlobals : Array < string > ;
149
+ filter : Path ;
150
+ findRelatedTests : boolean ;
151
+ forceCoverageMatch : Array < Glob > ;
152
+ forceExit : boolean ;
153
+ json : boolean ;
154
+ globals : ConfigGlobals ;
155
+ globalSetup : string | null | undefined ;
156
+ globalTeardown : string | null | undefined ;
157
+ haste : HasteConfig ;
158
+ reporters : Array < string | ReporterConfig > ;
159
+ logHeapUsage : boolean ;
160
+ lastCommit : boolean ;
161
+ listTests : boolean ;
162
+ mapCoverage : boolean ;
163
+ maxConcurrency : number ;
161
164
maxWorkers : number | string ;
162
- moduleDirectories ? : Array < string > ;
163
- moduleFileExtensions ? : Array < string > ;
164
- moduleLoader ? : Path ;
165
- moduleNameMapper ? : {
165
+ moduleDirectories : Array < string > ;
166
+ moduleFileExtensions : Array < string > ;
167
+ moduleLoader : Path ;
168
+ moduleNameMapper : {
166
169
[ key : string ] : string ;
167
170
} ;
168
- modulePathIgnorePatterns ? : Array < string > ;
169
- modulePaths ? : Array < string > ;
170
- name ? : string ;
171
- noStackTrace ? : boolean ;
172
- notify ? : boolean ;
173
- notifyMode ? : string ;
174
- onlyChanged ? : boolean ;
175
- outputFile ? : Path ;
176
- passWithNoTests ? : boolean ;
177
- preprocessorIgnorePatterns ? : Array < Glob > ;
178
- preset ? : string | null | undefined ;
179
- prettierPath ? : string | null | undefined ;
180
- projects ? : Array < Glob > ;
181
- replname ? : string | null | undefined ;
182
- resetMocks ? : boolean ;
183
- resetModules ? : boolean ;
184
- resolver ? : Path | null | undefined ;
185
- restoreMocks ? : boolean ;
171
+ modulePathIgnorePatterns : Array < string > ;
172
+ modulePaths : Array < string > ;
173
+ name : string ;
174
+ noStackTrace : boolean ;
175
+ notify : boolean ;
176
+ notifyMode : string ;
177
+ onlyChanged : boolean ;
178
+ outputFile : Path ;
179
+ passWithNoTests : boolean ;
180
+ preprocessorIgnorePatterns : Array < Glob > ;
181
+ preset : string | null | undefined ;
182
+ prettierPath : string | null | undefined ;
183
+ projects : Array < Glob > ;
184
+ replname : string | null | undefined ;
185
+ resetMocks : boolean ;
186
+ resetModules : boolean ;
187
+ resolver : Path | null | undefined ;
188
+ restoreMocks : boolean ;
186
189
rootDir : Path ;
187
- roots ? : Array < Path > ;
188
- runner ? : string ;
189
- runTestsByPath ? : boolean ;
190
- scriptPreprocessor ? : string ;
191
- setupFiles ? : Array < Path > ;
192
- setupTestFrameworkScriptFile ? : Path ;
193
- setupFilesAfterEnv ? : Array < Path > ;
194
- silent ? : boolean ;
195
- skipFilter ? : boolean ;
196
- skipNodeResolution ? : boolean ;
197
- snapshotResolver ? : Path ;
198
- snapshotSerializers ? : Array < Path > ;
199
- errorOnDeprecated ? : boolean ;
200
- testEnvironment ? : string ;
201
- testEnvironmentOptions ? : Record < string , any > ;
202
- testFailureExitCode ? : string | number ;
203
- testLocationInResults ? : boolean ;
204
- testMatch ? : Array < Glob > ;
205
- testNamePattern ? : string ;
206
- testPathDirs ? : Array < Path > ;
207
- testPathIgnorePatterns ? : Array < string > ;
208
- testRegex ? : string | Array < string > ;
209
- testResultsProcessor ? : string | null | undefined ;
210
- testRunner ? : string ;
211
- testSequencer ? : string ;
212
- testURL ? : string ;
213
- testTimeout ? : number ;
214
- timers ? : 'real' | 'fake' ;
215
- transform ? : {
190
+ roots : Array < Path > ;
191
+ runner : string ;
192
+ runTestsByPath : boolean ;
193
+ scriptPreprocessor : string ;
194
+ setupFiles : Array < Path > ;
195
+ setupTestFrameworkScriptFile : Path ;
196
+ setupFilesAfterEnv : Array < Path > ;
197
+ silent : boolean ;
198
+ skipFilter : boolean ;
199
+ skipNodeResolution : boolean ;
200
+ snapshotResolver : Path ;
201
+ snapshotSerializers : Array < Path > ;
202
+ errorOnDeprecated : boolean ;
203
+ testEnvironment : string ;
204
+ testEnvironmentOptions : Record < string , any > ;
205
+ testFailureExitCode : string | number ;
206
+ testLocationInResults : boolean ;
207
+ testMatch : Array < Glob > ;
208
+ testNamePattern : string ;
209
+ testPathDirs : Array < Path > ;
210
+ testPathIgnorePatterns : Array < string > ;
211
+ testRegex : string | Array < string > ;
212
+ testResultsProcessor : string | null | undefined ;
213
+ testRunner : string ;
214
+ testSequencer : string ;
215
+ testURL : string ;
216
+ testTimeout : number ;
217
+ timers : 'real' | 'fake' ;
218
+ transform : {
216
219
[ regex : string ] : Path | TransformerConfig ;
217
220
} ;
218
- transformIgnorePatterns ? : Array < Glob > ;
219
- watchPathIgnorePatterns ? : Array < string > ;
220
- unmockedModulePathPatterns ? : Array < string > ;
221
- updateSnapshot ? : boolean ;
222
- useStderr ? : boolean ;
223
- verbose ? : boolean | null | undefined ;
224
- watch ? : boolean ;
225
- watchAll ? : boolean ;
226
- watchman ? : boolean ;
227
- watchPlugins ? : Array < string | [ string , Record < string , any > ] > ;
228
- } ;
221
+ transformIgnorePatterns : Array < Glob > ;
222
+ watchPathIgnorePatterns : Array < string > ;
223
+ unmockedModulePathPatterns : Array < string > ;
224
+ updateSnapshot : boolean ;
225
+ useStderr : boolean ;
226
+ verbose : boolean | null | undefined ;
227
+ watch : boolean ;
228
+ watchAll : boolean ;
229
+ watchman : boolean ;
230
+ watchPlugins : Array < string | [ string , Record < string , any > ] > ;
231
+ } > ;
229
232
230
233
export type SnapshotUpdateState = 'all' | 'new' | 'none' ;
231
234
0 commit comments