cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject cordova-medic git commit: Making medic-check more robust.
Date Fri, 12 Jun 2015 00:55:55 GMT
Repository: cordova-medic
Updated Branches:
  refs/heads/master f2bf571af -> e7a4ec327


Making medic-check more robust.


Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/e7a4ec32
Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/e7a4ec32
Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/e7a4ec32

Branch: refs/heads/master
Commit: e7a4ec3270d9194e1a3b6899168ec9b2dc157eaa
Parents: f2bf571
Author: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Authored: Thu Jun 11 17:55:41 2015 -0700
Committer: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Committed: Thu Jun 11 17:55:41 2015 -0700

----------------------------------------------------------------------
 medic/medic-check.js | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/e7a4ec32/medic/medic-check.js
----------------------------------------------------------------------
diff --git a/medic/medic-check.js b/medic/medic-check.js
index 53219c5..008cbcc 100644
--- a/medic/medic-check.js
+++ b/medic/medic-check.js
@@ -30,6 +30,9 @@ var optimist = require("optimist");
 var util      = require("../lib/util");
 var testcheck = require("../lib/testcheck");
 
+// constants
+var INDENT = "    ";
+
 function main() {
 
     // get args
@@ -76,14 +79,22 @@ function main() {
                 console.log("Total failures: " + numFailures);
                 console.log("Failing tests:");
 
+                // print failures
                 testResults.mobilespec.results.forEach(function (result) {
+
                     if (result.status === "failed") {
-                        console.log(result.fullName);
+                        console.log(INDENT + result.fullName);
+
+                        // print all failed expectations
                         result.failedExpectations.forEach(function (expectation) {
-                            console.log("    " + expectation.message);
-                            expectation.stack.split('\n').forEach(function (traceLine) {
-                                console.log("        " + traceLine);
-                            });
+                            console.log(INDENT + INDENT + expectation.message);
+
+                            // print the stack trace if it exists
+                            if (typeof expectation.stack !== "undefined") {
+                                expectation.stack.split('\n').forEach(function (traceLine)
{
+                                    console.log(INDENT + INDENT + INDENT + traceLine);
+                                });
+                            }
                         });
                     }
                 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message