You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release also removes all deprecated types. This finally fixes an issue where Vitest accidentally pulled in `@types/node` (see [#5481](https://github.com/vitest-dev/vitest/issues/5481) and [#6141](https://github.com/vitest-dev/vitest/issues/6141)).
thrownewTypeError(`Siganture "test(name, fn, { ... })" was deprecated in Vitest 3 and removed in Vitest 4. Please, provide options as a second argument instead.`)
250
+
}
251
+
248
252
letoptions: TestOptions={}
249
253
letfn: T|undefined
250
254
251
-
// it('', () => {}, { retry: 2 })
252
-
if(typeofoptionsOrTest==='object'){
253
-
// it('', { retry: 2 }, { retry: 3 })
254
-
if(typeofoptionsOrFn==='object'){
255
-
thrownewTypeError(
256
-
'Cannot use two objects as arguments. Please provide options and a function callback in that order.',
257
-
)
258
-
}
259
-
console.warn(
260
-
'Using an object as a third argument is deprecated. Vitest 4 will throw an error if the third argument is not a timeout number. Please use the second argument for options. See more at https://vitest.dev/guide/migration',
261
-
)
262
-
options=optionsOrTest
263
-
}
264
255
// it('', () => {}, 1000)
265
-
elseif(typeofoptionsOrTest==='number'){
266
-
options={timeout: optionsOrTest}
256
+
if(typeoftimeoutOrTest==='number'){
257
+
options={timeout: timeoutOrTest}
267
258
}
268
259
// it('', { retry: 2 }, () => {})
269
260
elseif(typeofoptionsOrFn==='object'){
270
261
options=optionsOrFn
271
262
}
272
263
273
264
if(typeofoptionsOrFn==='function'){
274
-
if(typeofoptionsOrTest==='function'){
265
+
if(typeoftimeoutOrTest==='function'){
275
266
thrownewTypeError(
276
267
'Cannot use two functions as arguments. Please use the second argument for options.',
277
268
)
278
269
}
279
270
fn=optionsOrFnasT
280
271
}
281
-
elseif(typeofoptionsOrTest==='function'){
282
-
fn=optionsOrTestasT
272
+
elseif(typeoftimeoutOrTest==='function'){
273
+
fn=timeoutOrTestasT
283
274
}
284
275
285
276
return{
@@ -384,9 +375,9 @@ function createSuiteCollector(
0 commit comments