airportyh/testem — pull request #208 by EndangeredMassa (2013-05-08 22:15:41+00:00)
Title: zero tests should fail the test suite

There are times when you have a problem with your test setup, which can cause your tests to not be registered. When this happens, 0 tests are registered, and the test suite passes.

Test suites should not pass on 0 tests. It means that either (1) you just set up your test suite or (2) something went horribly wrong in your test setup. I can see where you may not want to show a failure to people in scenario (1), but I feel that saving users in scenario (2) seems like a much larger win.

This PR implements this for dev and ci modes. There are a few quirks of the implementation:

1. `lib/ci_mode_app.js:257` TAP has the same assumption that zero tests in a suite passes that suite. This works around that with a messy hack. Since you are already bundling tap in testem, perhaps this should be a change to that bundled version instead. Let me know what you think.

2. `lib/ui/runner_tabs.js:75` This code fixes an issue introduced by the rest of the changes that caused the launcher name in tabs to start out red (because of zero tests), then never turn green when the test suite finishes. This fixes that problem.