Skip to main content
Testing & QA Bug Hunt Easy +10 XP

Asserting Wrong Thing

This test always passes even with a bug.

Testing & QAFind the bug
1test('adds numbers', () => {
2 const result = add(2, 3);
3 expect(result);
4});
The bug is on line 3

Select the correct fix

Show answer and explanation

Answer: Add .toBe(5) to the assertion

expect(result) alone doesn't assert anything — it's an incomplete assertion. You must chain a matcher like .toBe(5).

Hint: expect() alone does nothing without a matcher.

What this challenge tests

Bug Hunt in Testing & QA: jest, assertions.

Related challenges