A passing test can still prove nothing
The Setup
Today I had a PostgreSQL integration test passing for the wrong reason. The test was supposed to prove that updating a missing Company returned a successful "not found" result.
I passed an id like: company-missing. But the database column was a UUID. PostgreSQL rejected the malformed value before Prisma could determine whether the Company existed. The repository returned a failure instead of the expected missing-record outcome.
Why It Passed
The test still passed. Why? Its assertion was inside a conditional success branch. Because the result was a failure, the branch never ran. The test completed with no failing assertion.
The Fix
The correction was small but important:
- Generate a valid UUID that was never inserted
- Assert the complete
Resultobject directly - Expect success with
undefineddata
That made the test exercise Prisma's real missing-record behavior instead of an invalid-input error.
The Lesson
A green test is not automatically evidence. Check that the intended branch was reached and that the assertion could actually fail.
Comments
No comments yet. Start the discussion.