From de3f453cfde642f79a0fbbef5418a12187797196 Mon Sep 17 00:00:00 2001 From: "Peter P. Gengler" Date: Sat, 17 Jul 2021 13:46:00 -0600 Subject: [PATCH 1/2] Fix mocha option from colors -> color --- client/shim.js | 2 +- index.js | 2 +- lib/cli.js | 4 ++-- test/api.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/shim.js b/client/shim.js index ad424ca..cd28380 100644 --- a/client/shim.js +++ b/client/shim.js @@ -12,7 +12,7 @@ mochaOptions = mochaOptions || { ui: 'bdd', reporter: 'spec', - colors: true + color: true }; mocha.setup(mochaOptions); diff --git a/index.js b/index.js index 29ef9fa..a0c3a10 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,7 @@ class MochaChrome { mocha: { reporter: 'spec', ui: 'bdd', - colors: true + color: true } }, options diff --git a/lib/cli.js b/lib/cli.js index a468e20..3327251 100755 --- a/lib/cli.js +++ b/lib/cli.js @@ -68,9 +68,9 @@ if (!/^(file|http(s?)):\/\//.test(file)) { url = `file://${fs.realpathSync(file)}`; } -const colors = !!flags.colors; +const color = !!flags.color; const reporter = flags.reporter || 'spec'; -const mocha = Object.assign(JSON.parse(flags.mocha || '{}'), { colors, reporter }); +const mocha = Object.assign(JSON.parse(flags.mocha || '{}'), { color, reporter }); const chromeFlags = JSON.parse(flags.chromeFlags || '[]'); const { chromeLauncher = {}, diff --git a/test/api.js b/test/api.js index 76db186..b1370ee 100644 --- a/test/api.js +++ b/test/api.js @@ -14,7 +14,7 @@ function test(options) { options = deepAssign( (options = { url, - mocha: { colors: false }, + mocha: { color: false }, ignoreConsole: true, ignoreExceptions: true, ignoreResourceErrors: true From a538162e4a89f7e7080c586c307a64d35f959482 Mon Sep 17 00:00:00 2001 From: "Peter P. Gengler" Date: Sat, 17 Jul 2021 13:58:23 -0600 Subject: [PATCH 2/2] Add peerDependency for mocha >= 7.0.0 --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 01b2b1d..00dda62 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,9 @@ "LICENSE", "README.md" ], + "peerDependencies": { + "mocha": ">= 7.0.0" + }, "dependencies": { "chalk": "^2.0.1", "chrome-launcher": "^0.13.4",