before_test and after_test should not trigger test reruns #209

johan opened this Issue May 9, 2013 · 3 comments


None yet
3 participants

johan commented May 9, 2013

A test with either (or both of) before_test / after_test configured behaves weirdly – each stage seems to trigger an all-test-results event and then restart the tests, often not finding any tests to run, causing the "0/0 tests" problem we turned into a failure state in zero tests should fail the test suite.

Wanted behaviour: the whole work unit before_test && test && after_test should succeed for all tests to pass, each step should run only once, and only in this order. (I often saw after_test run three times without any files changed while the tests ran, in a setup with both before and after scripts configured.)

(It is easy to dodge this issue by externalizing the before_test and after_test sections to the Makefile or similar that invokes testem, but you of course lose the TDD goodness of being able to edit your coffee sources and have testem rebuild and rerun tests automagically.)


airportyh commented May 10, 2013

Could you post a test case on a gist? I think it's because the generated files are also being watched.


airportyh commented May 10, 2013

I have some reservation about changing the definition of what should pass vs fail as a whole, I had been going by the philosophy of deferring that decision to the test framework being used. I would be more amendable to making that an option.


johanneswuerbach commented Jan 2, 2016

This should be resolved in the latest testem version. You can install it using npm install -g testem@1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment