Skip to content
</>Codeo's
Workshop
Testing

Testing is a Gift for the Future

Tests are not a burden, they are a safety net for brave changes.

</>

By Codeo

May 3, 2025 · 5 min read · Beginner

Tests are not a burden you carry. They are a gift you send forward in time to whoever needs to change this code under pressure.

1. A Safety Net for Brave Changes

The value of a test is not that it passes today. It is the confidence it gives someone to make a bold change tomorrow.

// Fragile
test("works", () => {
  expect(run()).toBe(true);
});
// Honest
test("rejects an expired token", () => {
  expect(auth(expired)).toEqual(DENIED);
});

2. Test the Behaviour, Not the Wiring

A test that mirrors the implementation breaks every time you refactor and proves nothing. Write the test against the promise the code makes to its caller.

A test you trust is worth ten you merely run.

Filed underTesting