Hacker News new | ask | show | jobs
by caspper69 498 days ago
This sounds like a design deficiency.

If you have something that should only run in testing, perhaps your test harness should set the global variable appropriately, no?

1 comments

Sure. And a million programmers have all screamed out in horror when they realize that their single test passes, but fails when run as part of the whole suite. Test contamination is a hell paved with global variables.
I can't agree more, I was dying this death a thousand times over at my last job.