expect-expect
Configuration
rslint.config.ts
Rule Details
Ensure every Jest test callback contains at least one assertion. The rule tracks test APIs such as test, it, fit, xit, and xtest (including chained forms like it.each that the Jest integration recognizes) and reports when none of the configured assertion callee patterns appear in the body. Assertions inside a named function declaration that is passed as the test callback are attributed to outer tests that reference that name. This guards against tests that run side effects but never verify outcomes.
Skipped test.todo / it.todo bodies are ignored.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
assertFunctionNames(default["expect"]): callee chains that count as assertions. Patterns follow eslint-plugin-jest:*matches a dot-separated segment;**matches zero or more segments. The pattern is matched case-insensitively against the full chain (for examplerequest.**.expectfor SuperTest.expect). Special regex characters in names may need escaping when mirroring ESLint behavior.additionalTestBlockFunctions: extra global function names treated liketest/itwrappers (for example helpers fromjest-theories) so their callbacks are also required to contain an assertion.
For more option examples and edge cases, see the upstream rule documentation linked below.