---
title: "Make every test able to fail · Agent Wranglers"
url: https://agentwranglers.se/playbook/testing/test-quality/tests-can-fail
updated: 2026-10-20
licence: "All rights reserved"
---

# Make every test able to fail

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Test quality](https://agentwranglers.se/playbook/testing/test-quality)
- Rule: Every test must contain a check that fails when the behaviour breaks. Tests without assertions or with always-true checks are not tests.
- How: Watch each new test fail once before making it pass. Turn on lint rules that catch empty or assertion-free tests, such as `vitest/expect-expect` or `jest/expect-expect`. Where no such rule exists, [mutation testing](https://agentwranglers.se/playbook/testing/test-quality/mutation-testing) finds tests that never fail. Await every asynchronous assertion.
- Check: The linter reports no test without an assertion. Breaking the code under a new test turns it red.

Example:

```js
// Bad: passes even when createUser is broken, because nothing is checked
test('creates a user', async () => { await createUser('ada@example.com'); });

// Good: fails when the user is not stored
test('creates a user', async () => {
  await createUser('ada@example.com');
  expect(await findUser('ada@example.com')).toMatchObject({ email: 'ada@example.com' });
});
```

```python
# Bad: nothing is checked
def test_creates_a_user():
    create_user("ada@example.com")

# Good: fails when the user is not stored
def test_creates_and_stores_a_user():
    create_user("ada@example.com")
    assert find_user("ada@example.com").email == "ada@example.com"
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers testing playbook: https://agentwranglers.se/playbook/testing/test-quality/tests-can-fail`.

- Previous: [Treat coverage as a floor](https://agentwranglers.se/playbook/testing/test-quality/coverage-floor)
- Next: [Review tests like code](https://agentwranglers.se/playbook/testing/test-quality/review-tests)
- [Test quality](https://agentwranglers.se/playbook/testing/test-quality)
