valid-expect
Added in v0.8.1Configuration
rslint.config.ts
Rule Details
Validates Rstest expect calls: they need the required arguments and a matcher, and asynchronous assertions must be awaited or returned so failures are not lost.
Rstest supports a message as the second expect argument and Chai-style property assertions; both are accepted by the rule.
Incorrect
Correct
Options
Autofix
An async assertion that is neither awaited nor returned is fixed by adding await, and by marking the enclosing function async when it is not already. Argument-count and matcher problems are reported without a fix.