vitest icon indicating copy to clipboard operation
vitest copied to clipboard

expect `toBeNullish`

Open MetRonnie opened this issue 10 months ago • 0 comments

Clear and concise description of the problem

Sometimes we don't care whether a value is undefined or null, we just want to test that it is nullish.

Suggested solution

I am proposing a new assertion, toBeNullish(). This would test value == null, i.e. that the value is either null or undefined.

Alternative

No response

Additional context

No response

Validations

MetRonnie avatar Apr 29 '25 10:04 MetRonnie