diff --git a/.mocharc.js b/.mocharc.js new file mode 100644 index 000000000..44fd10405 --- /dev/null +++ b/.mocharc.js @@ -0,0 +1,12 @@ +// Force mocha to exit after the test run completes. +// +// mocha 3 exited automatically when tests finished. mocha 4+ waits for the +// event loop to drain, so a test that leaks a handle (an open socket, a timer, +// a server still listening) keeps the process alive. In CI this makes the run +// reach the VM wall-clock cap and get killed, even though all tests passed. +// +// mocha searches upward for the nearest rc file, so this single root config +// applies to every package's `gulp test` task. +module.exports = { + exit: true, +}; diff --git a/package.json b/package.json index a5733f377..a5c9e4797 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "devDependencies": { "@types/execa": "^0.8.0", "@types/gulp": "^4.0.5", - "@types/gulp-mocha": "0.0.31", + "@types/gulp-mocha": "0.0.37", "@types/ncp": "^2.0.1", "@types/node": "^8.0.32", "@types/pify": "^3.0.0", @@ -21,7 +21,7 @@ "execa": "^0.8.0", "gulp": "^4.0.1", "gulp-jshint": "^2.0.4", - "gulp-mocha": "^4.3.1", + "gulp-mocha": "9.0.0", "gulp-sourcemaps": "^2.6.1", "gulp-tslint": "^8.1.1", "gulp-typescript": "^3.2.2", @@ -30,8 +30,8 @@ "jshint": "^2.9.5", "make-dir": "^1.1.0", "merge2": "^1.1.0", - "mocha": "^3.5.3", - "mocha-jenkins-reporter": "^0.3.9", + "mocha": "^10.8.2", + "mocha-jenkins-reporter": "^0.4.8", "ncp": "^2.0.0", "nyc": "^11.7.2", "pify": "^3.0.0", @@ -59,6 +59,14 @@ "cache": true, "all": true }, + "overrides": { + "mocha": { + "serialize-javascript": "^7.0.5" + }, + "mocha-jenkins-reporter": { + "diff": "^4.0.4" + } + }, "scripts": { "test": "nyc gulp test", "coverage": "nyc report --reporter=text-lcov | coveralls" diff --git a/test/client-libraries-integration/package.json b/test/client-libraries-integration/package.json index 784714eeb..b70101dd8 100644 --- a/test/client-libraries-integration/package.json +++ b/test/client-libraries-integration/package.json @@ -5,7 +5,7 @@ "dependencies": { "dot-prop": "^5.2.0", "google-proto-files": "^0.15.1", - "mocha": "^5.0.4", + "mocha": "^10.8.2", "shimmer": "^1.2.0" } }