Capture and display browser logs when unit tests fail

This commit is contained in:
Scott Nonnenberg 2017-05-17 18:00:59 -07:00
parent c8013d930c
commit f4aa6d93a7
No known key found for this signature in database
GPG key ID: A4931C09644C654B

View file

@ -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);