Use dot reporter under Windows since spec doesn't handle ANSI color characters due to the fact that tests are executed as an electron app

This commit is contained in:
Dirk Baeumer 2017-05-24 09:59:15 +02:00
parent 1281eab369
commit 0938fe05a7

View file

@ -17,7 +17,7 @@ const optimist = require('optimist')
.describe('build', 'run with build output (out-build)').boolean('build')
.describe('coverage', 'generate coverage report').boolean('coverage')
.describe('debug', 'open dev tools, keep window open, reuse app data').string('debug')
.describe('reporter', 'the mocha reporter').string('reporter').default('reporter', 'spec')
.describe('reporter', 'the mocha reporter').string('reporter').default('reporter', process.platform === 'win32' ? 'dot' : 'spec')
.describe('help', 'show the help').alias('help', 'h');
const argv = optimist.argv;
@ -113,7 +113,7 @@ app.on('ready', () => {
Reporter = require(reporterPath);
} catch (err) {
console.warn(`could not load reporter: ${argv.reporter}`);
Reporter = mocha.reporters.Spec;
Reporter = process.platform === 'win32' ? mocha.reporters.Dot : mocha.reporters.Spec;
}
const runner = new IPCRunner();