I am using Mocha to run some tests on my SnailMailAddressParser project from the command-line. Unfortunately only some tests are run before Mocha exits.
The test file is very straightforward. You can see the test file here: test/test.coffee
It seems there is a race condition somewhere. When I run npm test
, it does one of two things:
- Runs one test; or
- Runs 34 tests, starting at address_tester.
Clearly I am doing something asynchronous that needs to be caught, but I am not quite sure what yet. In any case, I do not know how to tell Mocha to wait for any asynchronous items to be reaped (i.e. some sort of Mocha.wait_all
, if that is even possible - perhaps I have to add' done()
calls, but I didn't think that was necessary for synchronous testing - which I thought this might be).
I will experiment of course and post any answers I glean from my testing, but I would be grateful for any insight.