Skip to content

Commit a0c0258

Browse files
committed
Allow custom stackFilter function
1 parent 6a49f72 commit a0c0258

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/reporters/console_reporter.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function ConsoleReporter(options) {
2323
yellow: '\x1B[33m',
2424
none: '\x1B[0m'
2525
},
26-
failedSuites = [];
26+
failedSuites = [],
27+
stackFilter = options.stackFilter || defaultStackFilter;
2728

2829
if(options.onComplete) {
2930
printDeprecation('Passing in an onComplete function to the ConsoleReporter is deprecated.');
@@ -141,7 +142,7 @@ function ConsoleReporter(options) {
141142
return newArr.join('\n');
142143
}
143144

144-
function filterStack(stack) {
145+
function defaultStackFilter(stack) {
145146
var filteredStack = stack.split('\n').filter(function(stackLine) {
146147
return stackLine.indexOf(jasmineCorePath) === -1;
147148
}).join('\n');
@@ -162,7 +163,7 @@ function ConsoleReporter(options) {
162163
printNewline();
163164
print(indent('Stack:', 2));
164165
printNewline();
165-
print(indent(filterStack(failedExpectation.stack), 4));
166+
print(indent(stackFilter(failedExpectation.stack), 4));
166167
}
167168

168169
printNewline();

0 commit comments

Comments
 (0)