import { expect, test } from 'vitest'
test('repro', { timeout: 2000 }, async () => {
await expect.poll(async () => {
return 4321
}, { timeout: 10000 }).toBe(1234)
})
FAIL test/repro.test.ts > repro
Error: Test timed out in 2000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
❯ test/repro.test.ts:3:1
1| import { expect, test } from 'vitest';
2|
3| test('repro', { timeout: 2000 }, async () => {
| ^
4| await expect
5| .poll(
Describe the bug
When test timeout occurs with pending
expect.polllike below:the timeout error points to the test definition only and the actual cause of
expect.pollis unclear.Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-vmfmewqp?file=test%2Frepro.test.ts
System Info
Used Package Manager
npm
Validations