Skip to content

Commit

Permalink
fix(adapter): do not emit debug url unless in a browser (#263)
Browse files Browse the repository at this point in the history
Surprise: someone uses karma-jasmine with native=script.
Fixes #262
  • Loading branch information
johnjbarton committed Feb 11, 2020
1 parent fb33d57 commit 9bcce88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/adapter.js
Expand Up @@ -247,8 +247,10 @@ function KarmaReporter (tc, jasmineEnv) {
result.log.push(formatFailedStep(steps[i]))
}

// Report the name of fhe failing spec so the reporter can emit a debug url.
result.debug_url = debugUrl(specResult.fullName)
if (typeof window !== 'undefined' && window.location && window.location.origin) {
// Report the name of fhe failing spec so the reporter can emit a debug url.
result.debug_url = debugUrl(specResult.fullName)
}
}

// When failSpecWithNoExpectations is true, Jasmine will report specs without expectations as failed
Expand Down

0 comments on commit 9bcce88

Please sign in to comment.