Warning: Express’ tests break under forthcoming Mocha v4.0.0

I ran express’ master tests against Mocha’s current master branch (via dont-break), and the tests did not complete (the Node.js process hangs).

This is likely because of a forthcoming change in v4 which will cause Mocha to not force exit its own process once it’s finished running tests (by default). See this issue for more background.

If I had to hazard a guess, likely one or more of Express’ tests are leaving socket(s) open instead of closing them explicitly.

If Express wishes to upgrade, its options are:

  1. Audit the tests and ensure they are not leaving any sockets, servers, etc., open/listening when they complete, or
  2. Revert to pre-v4 behavior by supplying the --exit option to Mocha

Author: Fantashit

2 thoughts on “Warning: Express’ tests break under forthcoming Mocha v4.0.0

  1. Right. I effectively resolved using option 1 and went ahead and used the flag to make mocha v3 behave like v4 will to be ready.

Comments are closed.