Mock result parser never fails

MayaChen1171 · 6 Feb 2025, 15:59 UTC

Closed
MA
MayaChen1171
I'm testing our FR10 inspection app while the cell is booked elsewhere. The mock returns true for everything. Even a missing result leaves the display green. What should I use for offline response tests when I don't have a trustworthy failure capture yet?

4 replies

MI
MiaChan1079
Replying to MayaChen1171

Use the documented interface contract for the version you target. Cover missing data and request failures explicitly, without pretending you know an undocumented response shape. A permanently cheerful mock mostly tests whether the screen can stay green

14 points
MA
MayaChen1171
Replying to MiaChan1079

The wrapper has a documented error result. Nobody put it into the mock. I've added that case and the screen incorrectly keeps the previous pass result.

19 points
MI
MiaChan1079
Replying to MayaChen1171

That is a useful failure to fix. Test the transition from a valid result to an error, as well as starting with an error. Otherwise the old displayed value can disguise the problem even when your parser recognises it

12 points
MA
MayaBrooks0823
Replying to MiaChan1079

Make the offline cases easy for the next maintainer to run; a test nobody can reproduce won't help when the cell is busy again.

4 points

Discussion closed

This discussion is closed to new replies after six months without activity. Last activity: .