From 9e0f387e8093e63810abebf7a6c30c5b9eb4d171 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 22 May 2018 19:25:35 -0700 Subject: [PATCH] Print out main process logs if electron unit tests fail --- Gruntfile.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 4b23b8bda..922b9016a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -380,7 +380,19 @@ module.exports = function(grunt) { // We need to use the failure variable and this early stop to clean up before // shutting down. Grunt's fail methods are the only way to set the return value, // but they shut the process down immediately! - return app.stop(); + if (failure) { + console.log(); + console.log('Main process logs:'); + return app.client.getMainProcessLogs().then(function(logs) { + logs.forEach(function(log) { + console.log(log); + }); + + return app.stop(); + }); + } else { + return app.stop(); + } }) .then(function() { if (failure) {