diff --git a/client/shim.js b/client/shim.js index ad424ca..18a1177 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); @@ -55,10 +55,14 @@ m.runner = origRun.apply(mocha, arguments); if (m.runner.stats && m.runner.stats.end) { - window._eventbus.emit('ended', m.runner.stats); + setTimeout(()=>{ + window._eventbus.emit('ended', m.runner.stats); + }, 2000) } else { m.runner.on('end', () => { - window._eventbus.emit('ended', m.runner.stats); + setTimeout(()=>{ + window._eventbus.emit('ended', m.runner.stats); + }, 2000) }); } return m.runner; 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/package.json b/package.json index 01b2b1d..3f4be29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "mocha-chrome", - "version": "2.2.0", + "name": "digabi-mocha-chrome", + "version": "2.3.0", "description": "☕ Run Mocha tests using headless Google Chrome", "license": "MIT", "repository": "shellscape/mocha-chrome", @@ -31,6 +31,9 @@ "LICENSE", "README.md" ], + "peerDependencies": { + "mocha": ">= 7.0.0" + }, "dependencies": { "chalk": "^2.0.1", "chrome-launcher": "^0.13.4", 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