One assertion checks several conditions joined with &&, so a failure does not say which one
What it finds
expect(a && b).toBe(true) or assert(a && b) fails with "expected true, received false" and leaves open which part failed. One assertion per condition reports the one that did.
Reported are expect of an && expression followed by toBe(true) or toBeTruthy(), and assert or assert.ok of an && expression.
From the rule's source, combined_assertion.rs.
it("is valid", () => { expect(user.name && user.email).toBeTruthy();tx0 reports: this assertion joins several conditions expect(user.name).toBeTruthy();});declare const user: { name: string; email: string }; Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:combined-assertion" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:combined-assertion] reason="..."tx0 explain tx0/ts:combined-assertion shows the same in the terminal. Found a false positive? Report it.