Skip to content
RED SAG Skills
easy5 pts · first answer countstest-automationjestunit-testing

A toThrow test that errors

Why does this Jest test crash instead of passing?

test('rejects negative quantity', () => {
  expect(addToCart(-1)).toThrow('quantity must be positive')
})
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions