One behaviour per test, however many assertions it takes
The rule "one assert per test" produces twenty tests that share setup and fail together. The useful rule is one behaviour: arrange, act once, then assert everything that behaviour implies.
it("cancelling a shipped order refunds nothing and keeps the shipment", () => {
const result = cancel(shippedOrder);
expect(result.refund).toBe(0);
expect(result.shipment.status).toBe("in_transit");
});When it fails, the name says which behaviour broke and the assertions say how.
testing