hard20 pts · first answer countstest-automationunit-testingassertions
A test that can never fail
Why does this test always pass, even when no "Overdue" invoice exists?
test('flags overdue invoices', () => {
const invoices = getInvoices()
invoices.filter((i) => i.status === 'Overdue').forEach((i) => {
expect(i.reminderSent).toBe(true)
})
})Discussion 0
Join free to post in the discussion.
Related questions
- toBe versus toEqualAutomation Test Engineer
- Arrange, Act, AssertAutomation Test Engineer
- An upside-down test pyramidAutomation Test Engineer
- Sharing fixtures in pytestAutomation Test Engineer
- Asserting that an error is raisedAutomation Test Engineer
- Running pytest in parallelAutomation Test Engineer
- A keyword-driven frameworkAutomation Test Engineer
- Layers in a test frameworkAutomation Test Engineer