Skip to content

Commit

Permalink
WIP feat(cli): Echo the runner progress event, don't echo in runner
Browse files Browse the repository at this point in the history
The CLI shall echo the progress, not the runner itself.

Fixes karma-runner#2121, karma-runner#2799
  • Loading branch information
is-already-taken committed Apr 10, 2019
1 parent 5fca98e commit 8ebb5a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ function describeCompletion () {
.describe('help', 'Print usage.')
}

function printRunnerProgress(data) {
process.stdout.write(data)
}

exports.process = function () {
const argv = optimist.parse(argsBeforeDoubleDash(process.argv.slice(2)))
const options = {
Expand Down Expand Up @@ -291,7 +295,9 @@ exports.run = function () {
new Server(config).start()
break
case 'run':
require('./runner').run(config)
require('./runner')
.run(config)
.on('progress', printRunnerProgress)
break
case 'stop':
require('./stopper').stop(config)
Expand Down
1 change: 0 additions & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function run (config, done) {
const parsedResult = parseExitCode(buffer, exitCode, config.failOnEmptyTestSuite)
exitCode = parsedResult.exitCode
emitter.emit('progress', parsedResult.buffer)
process.stdout.write(parsedResult.buffer)
})

response.on('end', () => done(exitCode))
Expand Down

0 comments on commit 8ebb5a7

Please sign in to comment.