Skip to content
Preptima
mediumConceptEntryMidSenior

A test fails in CI and all you get is 'expected true, got false'. What should the framework have given you instead?

4 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup

Answer

Short answer

A failure has to be diagnosable from its artefacts alone, because nobody can attach a debugger to a CI run: that means assertions that report the compared values, a message naming the business expectation, and captured evidence of the state at the moment of failure.

Was this answer helpful?

Likely follow-ups

  • Your assertion now prints both values and they look identical on screen. What next?
  • How would you make a timeout failure say what it was waiting for and what it saw instead?
  • What do you capture on a failure that you deliberately do not capture on a pass, and why?
  • A single failing test produces 200 MB of artefacts. How do you decide what to keep?

Related questions