Skip to content

Commit c4485c6

Browse files
committed
docs: clarify the timeout number is supported
1 parent ee0b6b0 commit c4485c6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/guide/migration.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,19 @@ Vitest 4.0 removes some deprecated APIs, including:
440440
- `deps.external`, `deps.inline`, `deps.fallbackCJS` config options. Use `server.deps.external`, `server.deps.inline`, or `server.deps.fallbackCJS` instead.
441441
- `browser.testerScripts` config option. Use [`browser.testerHtmlPath`](/guide/browser/config#browser-testerhtmlpath) instead.
442442
- `minWorkers` config option. Only `maxWorkers` has any effect on how tests are running, so we are removing this public option.
443-
- Vitest no longer supports providing test options as a third argument to `test` and `describe`. Use the second argument instead:
443+
- Vitest no longer supports providing test options object as a third argument to `test` and `describe`. Use the second argument instead:
444444

445445
```ts
446446
test('example', () => { /* ... */ }, { retry: 2 }) // [!code --]
447447
test('example', { retry: 2 }, () => { /* ... */ }) // [!code ++]
448448
```
449449

450+
Note that providing a timeout number as the last argument is still supported:
451+
452+
```ts
453+
test('example', () => { /* ... */ }, 1000) //
454+
```
455+
450456
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)).
451457

452458
## Migrating from Jest {#jest}

0 commit comments

Comments
 (0)