diff --git a/spec/atom-reporter.coffee b/spec/atom-reporter.coffee index 5636647ca..90e15106e 100644 --- a/spec/atom-reporter.coffee +++ b/spec/atom-reporter.coffee @@ -166,13 +166,26 @@ class SpecResultView extends View @description.html @spec.description for result in @spec.results().getItems() when not result.passed() + stackTrace = @formatStackTrace(result.trace.stack) @specFailures.append $$ -> @div result.message, class: 'resultMessage fail' - @div result.trace.stack, class: 'stackTrace' if result.trace.stack + @div stackTrace, class: 'stackTrace' if stackTrace attach: -> @parentSuiteView().append this + formatStackTrace: (stackTrace) -> + return stackTrace unless stackTrace + + jasminePath = require.resolve('jasmine') + jasminePattern = new RegExp("\\(#{_.escapeRegExp(jasminePath)}:\\d+:\\d+\\)\\s*$") + convertedLines = [] + for line in stackTrace.split('\n') + unless jasminePattern.test(line) + convertedLines.push(line) + + convertedLines.join('\n') + parentSuiteView: -> if not suiteView = $(".suite-view-#{@spec.suite.id}").view() suiteView = new SuiteResultView(@spec.suite)