Assertion
also: assertions, assert, asserts
The line in a test that checks a result is what you expected. If that check fails, the test fails.
A statement in a test, such as expect(total).toBe(20), that compares an actual value with an expected one and fails the test if they differ. A test is only as strong as its assertions.
The recipe step that says "the cake should spring back when pressed". Baking is the test; the press is the assertion. Skip it and you never find out if the cake is done.
A test with weak assertions passes no matter what. Agents sometimes check only that "something came back" instead of the actual value. Reading the assertions is the fastest way to judge a test.
I tightened the assertions: instead of checking the response is defined, the test now checks the status is 201 and the returned title matches.
In each test, assert the exact expected values, not just that something was returned. Show me the assertions for the refund tests.
Assuming a passing test proves the feature works. It only proves the assertions held. If they check almost nothing, the pass means almost nothing.