Jest Vitest Assertion Pitfalls

Use when Jest or Vitest tests are written or reviewed for assertions that never run or prove nothing: async expect not awaited, expect.poll and promise chains, expect inside if or catch, a test with no expect, expect outside a test, the done callback, toThrow without a message, toEqual on errors, focused and disabled tests, identical titles, exporting from a test file, strict equality, bare toHaveBeenCalled, snapshot size and interpolation, concurrent snapshots, Vitest hoisting and typed mocks, Jest v30 removed aliases.

techmefr Updated

File contents

techmefr/mentis commit de8b1ae2d0

Frequently asked questions

npx get-skill add techmefr/jest-vitest-assertion-pitfalls