Assertion
The line inside a test that declares what must be true. If reality disagrees, the test fails and shows you what it got instead.
See it
What it is
An assertion is the line in a test that states what must be true: expect(total).toBe(42), assert.equal(status, 200), expect(page.getByRole('heading')).toHaveText('Welcome'). If reality disagrees, the test fails and the runner prints what it got instead. Everything else in a test is setup; this is the actual claim.
Pick the matcher that produces the most useful failure message. toEqual compares structure, toBe compares identity, toContain and toMatchObject let you assert on the part you care about instead of the whole blob. A precise matcher turns a red build into a diff you can read in two seconds.
Gotcha: a test with no assertion passes forever and tells you nothing. The sneaky version of this is the forgotten await: an async assertion that returns a promise nobody waits on will let a broken test go green. Prove your assertions work by breaking the code on purpose once and watching them fail.
Ask AI for it
Rewrite the assertions in this test file using Vitest expect matchers that give readable failure output: toEqual for object and array shape, toBe for primitives, toContain for substrings, and rejects.toThrow for error paths. Await every async assertion, add an explicit message where the failure would otherwise be ambiguous, and make sure each test has at least one assertion that can actually fail.