tests: Use wtfnode to determine why mocha isn't exiting

If mocha hangs after running the tests, hit Ctrl-C and wtfnode will
print open files, open sockets, running timers, and running intervals.
Adding an `after` function that closes/stops all of those things will
ensure that mocha exits when it finishes running the tests.
This commit is contained in:
Richard Hansen 2020-09-14 19:45:51 -04:00 committed by John McLear
parent e20731cb12
commit ae1142a799
2 changed files with 9 additions and 2 deletions

View file

@ -80,7 +80,8 @@
"nyc": "15.0.1",
"set-cookie-parser": "^2.4.6",
"supertest": "4.0.2",
"wd": "1.12.1"
"wd": "1.12.1",
"wtfnode": "^0.8.3"
},
"engines": {
"node": ">=10.13.0",
@ -91,7 +92,7 @@
"url": "https://github.com/ether/etherpad-lite.git"
},
"scripts": {
"test": "nyc mocha --timeout 5000 --recursive ../tests/backend/specs",
"test": "nyc wtfnode node_modules/.bin/_mocha --timeout 5000 --recursive ../tests/backend/specs",
"test-contentcollector": "nyc mocha --timeout 5000 ../tests/backend/specs",
"test-container": "nyc mocha --timeout 5000 ../tests/container/specs/api"
},