Bug 1083068 - Improve SDK logging when a promise is rejected during tests. r=gozala
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 15 Oct 2014 01:11:00 -0400
changeset 212248 da49be9b113989643efe9720a29a1d694311cf5f
parent 212247 5a514513e3e6b43e1de91c5e965a57df1d827ce5
child 212249 e5d757477ec15b623b072a56f986e1b0fee516a9
push id27702
push userkwierso@gmail.com
push dateFri, 24 Oct 2014 22:05:50 +0000
treeherdermozilla-central@c70f62375f7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgozala
bugs1083068
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1083068 - Improve SDK logging when a promise is rejected during tests. r=gozala
addon-sdk/source/lib/sdk/deprecated/unit-test.js
--- a/addon-sdk/source/lib/sdk/deprecated/unit-test.js
+++ b/addon-sdk/source/lib/sdk/deprecated/unit-test.js
@@ -57,17 +57,18 @@ TestRunner.prototype = {
 
   _logTestFailed: function _logTestFailed(why) {
     if (!(why in this.test.errors))
       this.test.errors[why] = 0;
     this.test.errors[why]++;
   },
 
   _uncaughtErrorObserver: function({message, date, fileName, stack, lineNumber}) {
-    this.fail("There was an uncaught Promise rejection: " + stack);
+    this.fail("There was an uncaught Promise rejection: " + message + " @ " +
+              fileName + ":" + lineNumber + "\n" + stack);
   },
 
   pass: function pass(message) {
     if(!this.expectFailure) {
       if ("testMessage" in this.console)
         this.console.testMessage(true, true, this.test.name, message);
       else
         this.console.info("pass:", message);