Update Mocha to 8.2.1
The changes can be seen here between 8.0.1 and 8.2.1:
https://github.com/mochajs/mocha/releases
There are no breaking changes.
The upgrade will give us the ability to use global fixtures which
may speed up parallel mode. I'm also hoping this fixes a bug with
describe.skip() not working properly for parallel mode.
DISABLE_THIRD_PARTY_CHECK=Update Mocha
Bug: chromium:1101784
Change-Id: Ia052a80c0f6dcefb1a2f21444cdfd3789a3203f8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2529149
Reviewed-by: Tim van der Lippe <[email protected]>
Commit-Queue: Peter Marshall <[email protected]>
diff --git a/node_modules/mocha/lib/cli/run.js b/node_modules/mocha/lib/cli/run.js
index 6582a4e..a8c8b61 100644
--- a/node_modules/mocha/lib/cli/run.js
+++ b/node_modules/mocha/lib/cli/run.js
@@ -19,8 +19,7 @@
const {
list,
handleRequires,
- validatePlugin,
- loadRootHooks,
+ validateLegacyPlugin,
runMocha
} = require('./run-helpers');
const {ONE_AND_DONES, ONE_AND_DONE_ARGS} = require('./one-and-dones');
@@ -339,13 +338,10 @@
// currently a failing middleware does not work nicely with yargs' `fail()`.
try {
// load requires first, because it can impact "plugin" validation
- const rawRootHooks = await handleRequires(argv.require);
- validatePlugin(argv, 'reporter', Mocha.reporters);
- validatePlugin(argv, 'ui', Mocha.interfaces);
-
- if (rawRootHooks && rawRootHooks.length) {
- argv.rootHooks = await loadRootHooks(rawRootHooks);
- }
+ const plugins = await handleRequires(argv.require);
+ validateLegacyPlugin(argv, 'reporter', Mocha.reporters);
+ validateLegacyPlugin(argv, 'ui', Mocha.interfaces);
+ Object.assign(argv, plugins);
} catch (err) {
// this could be a bad --require, bad reporter, ui, etc.
console.error(`\n${symbols.error} ${ansi.red('ERROR:')}`, err);