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() {
|
failure = function() {
|
||||||
grunt.fail.fatal('Found ' + results.failures + ' failing unit tests.');
|
grunt.fail.fatal('Found ' + results.failures + ' failing unit tests.');
|
||||||
};
|
};
|
||||||
|
return app.client.log('browser');
|
||||||
} else {
|
} else {
|
||||||
grunt.log.ok(results.passes + ' tests passed.');
|
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) {
|
}).catch(function (error) {
|
||||||
failure = function() {
|
failure = function() {
|
||||||
grunt.fail.fatal('Something went wrong: ' + error.message + ' ' + error.stack);
|
grunt.fail.fatal('Something went wrong: ' + error.message + ' ' + error.stack);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue