ExpectOptions
boolean
false
The same as calling expect.hasAssertions() at the start of every test. This makes sure that no test will pass accidentally.
This only works with Vitest's expect. If you use assert or .should assertions, they will not count, and your test will fail due to the lack of expect assertions.
You can change the value of this by calling vi.setConfig({ expect: { requireAssertions: false } }). The config will be applied to every subsequent expect call until the vi.resetConfig is called manually.
When you run tests with sequence.concurrent and expect.requireAssertions set to true, you should use local expect instead of the global one. Otherwise, this may cause false negatives in some situations (#8469).
Global configuration options for expect.poll. These are the same options you can pass down to expect.poll(condition, options).
number
50
Polling interval in milliseconds
number
1000
Polling timeout in milliseconds
© 2021-Present VoidZero Inc. and Vitest contributors
Licensed under the MIT License.
https://vitest.dev/config/expect