Skip to content

Commit

Permalink
fix(client): Only create the funky object if message is not a string
Browse files Browse the repository at this point in the history
Fixes #3296
  • Loading branch information
johnjbarton committed Apr 12, 2019
1 parent 7eb48c5 commit 811c514
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ function Karma (socket, iframe, opener, navigator, location) {
message += '\n\n' + error.stack
}

// create an object with the string representation of the message to ensure all its content is properly
// transferred to the console log
message = {message: message, str: message.toString()}
if (typeof message !== 'string') {
// create an object with the string representation of the message to ensure all its content is properly
// transferred to the console log
message = {message: message, str: message.toString()}
}

socket.emit('karma_error', message)
this.complete()
Expand Down

0 comments on commit 811c514

Please sign in to comment.