Print afterAllExceptions to the console.
- Add afterAllException function to ConsoleReporter - Print the stack traces of the errors at the end of the console output [#67055730]
This commit is contained in:
@@ -19,7 +19,8 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
||||
red: '\x1B[31m',
|
||||
yellow: '\x1B[33m',
|
||||
none: '\x1B[0m'
|
||||
};
|
||||
},
|
||||
exceptionList = [];
|
||||
|
||||
this.jasmineStarted = function() {
|
||||
specCount = 0;
|
||||
@@ -49,9 +50,16 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
||||
printNewline();
|
||||
var seconds = timer.elapsed() / 1000;
|
||||
print('Finished in ' + seconds + ' ' + plural('second', seconds));
|
||||
|
||||
printNewline();
|
||||
|
||||
exceptionList.forEach(function(error) {
|
||||
printNewline();
|
||||
print(colored('red', 'An error was thrown in an afterAll'));
|
||||
printNewline();
|
||||
print(colored('red', error.stack));
|
||||
printNewline();
|
||||
});
|
||||
|
||||
onComplete(failureCount === 0);
|
||||
};
|
||||
|
||||
@@ -76,6 +84,10 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
||||
}
|
||||
};
|
||||
|
||||
this.afterAllException = function(error) {
|
||||
exceptionList.push(error);
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
function printNewline() {
|
||||
|
||||
Reference in New Issue
Block a user