Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #90 from delfrrr/master
Browse files Browse the repository at this point in the history
do not lost stack trace at debug.html
  • Loading branch information
dignifiedquire committed Mar 18, 2016
2 parents 3aff4f9 + 0b5a392 commit 35d047d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ var haveMochaConfig = function (karma) {
}

var createMochaReporterConstructor = function (tc, pathname) {
var isDebugPage = /debug.html$/.test(pathname)

// Set custom reporter on debug page
if (/debug.html$/.test(pathname) && haveMochaConfig(tc) && tc.config.mocha.reporter) {
if (isDebugPage && haveMochaConfig(tc) && tc.config.mocha.reporter) {
createMochaReporterNode()
return tc.config.mocha.reporter
}
Expand Down Expand Up @@ -95,11 +97,11 @@ var createMochaReporterConstructor = function (tc, pathname) {
var assertionError = processAssertionError(error)

if (test.type === 'hook') {
test.$errors = [simpleError]
test.$errors = isDebugPage ? [error] : [simpleError]
test.$assertionErrors = assertionError ? [assertionError] : []
runner.emit('test end', test)
} else {
test.$errors.push(simpleError)
test.$errors.push(isDebugPage ? error : simpleError)
if (assertionError) test.$assertionErrors.push(assertionError)
}
})
Expand Down

0 comments on commit 35d047d

Please sign in to comment.