Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
fix: ensure console output from phantomjs is available in karma debug…
Browse files Browse the repository at this point in the history
… logs
  • Loading branch information
park9140 committed Jul 29, 2015
1 parent e20469c commit eed281b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions capture.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
page.settings.<%= key %> = <%= value %>
<% }) %>

page.onConsoleMessage = function () {
console.log.apply(console, arguments)
}

<% if (debug) { %>
function debugPage() {
console.log('Launch the debugger page at http://localhost:9000/webkit/inspector/inspector.html?page=2')
Expand Down
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ var PhantomJSBrowser = function (baseBrowserDecorator, config, args, logger) {
// and start phantomjs
this._execCommand(this._getCommand(), flags)

this._process.stderr.on('data', function (data) {
log.error('' + data)
})

this._process.stdout.on('data', function (data) {
log.debug('' + data)
})

if (args.debug) {
log.info('ACTION REQUIRED:')
log.info('')
Expand Down

0 comments on commit eed281b

Please sign in to comment.