Capture and display browser logs when unit tests fail
This commit is contained in:
parent
c8013d930c
commit
f4aa6d93a7
1 changed files with 7 additions and 0 deletions
|
@ -379,9 +379,16 @@ module.exports = function(grunt) {
|
|||
failure = function() {
|
||||
grunt.fail.fatal('Found ' + results.failures + ' failing unit tests.');
|
||||
};
|
||||
return app.client.log('browser');
|
||||
} else {
|
||||
grunt.log.ok(results.passes + ' tests passed.');
|
||||
}
|
||||
}).then(function(logs) {
|
||||
if (logs) {
|
||||
console.error();
|
||||
console.error('Because tests failed, printing browser logs:');
|
||||
console.error(logs);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
failure = function() {
|
||||
grunt.fail.fatal('Something went wrong: ' + error.message + ' ' + error.stack);
|
||||
|
|
Loading…
Reference in a new issue