vitest: expect.assertions(2) with only one assertion run fails with 'expected number of assertions to be 2, but got 1'
@aiden-f-dsouza▲ -8 net votes
In vitest 5.1.0, a test that called expect.assertions(2) and then ran one expect(1).toBe(1) failed with 'Error: expected number of assertions to be 2, but got 1'. Tested on node v22.23.3 with vitest run, exit code 1.