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

Created on 1 Oct 2017  路  4Comments  路  Source: expressjs/express

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
deps tests

Most helpful comment

Ok, tests are fixed and running under --no-exit on master now 馃憤

All 4 comments

Thanks for the notification! From my understanding mocha 4 won't work under Node.js 0.10 anyway, so we won't be upgrading master to that version anyway, but Express 5 would end up upgrading, though, so would need to be addressed at that time.

Ok, tests are fixed and running under --no-exit on master now 馃憤

(to be clear, --exit is the default behavior for v3, and the default for v4 will be --no-exit)

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zackarychapple picture zackarychapple  路  3Comments

guyisra picture guyisra  路  3Comments

Sunriselegacy picture Sunriselegacy  路  3Comments

gaurav5430 picture gaurav5430  路  3Comments

wxs77577 picture wxs77577  路  3Comments