Skip to content

Commit

Permalink
feat: print out console debug/info/warn/error
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Jan 14, 2020
1 parent 860bbd7 commit 390df91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/browser-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const destroyable = require('server-destroy');
const kebabCase = require('lodash.kebabcase');
const getBrowser = require('./get-browser');
const once = require('lodash.once');
const c = require('ansi-colors');

const reporterPath = path.join(__dirname, '..', 'dist', 'reporter.js');
const jasmineTapReporterPath = path.join(__dirname, '..', 'jasmine-tap-reporter.js');
Expand Down Expand Up @@ -173,6 +174,10 @@ function runner (opts, data, output) {
let coverage;
io.on('connection', socket => {
socket.on('log', msg => output.write(msg + '\n'));
socket.on('debug', msg => console.info(c.bgWhite(msg)));
socket.on('info', msg => console.info(c.bgCyan(msg)));
socket.on('warn', msg => console.warn(c.bgYellow(msg)));
socket.on('error', msg => console.error(c.bgRed(msg)));
socket.on('coverage', msg => coverage = msg);
});

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"tape": "^4.12.1"
},
"dependencies": {
"ansi-colors": "^4.1.1",
"commander": "^4.0.1",
"duplexer": "^0.1.1",
"electron": "^7.1.7",
Expand Down

0 comments on commit 390df91

Please sign in to comment.