From 353c01f04fbd2b7f8c88f9baf287d01f114834f3 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Fri, 2 Oct 2015 14:47:57 +0200 Subject: [PATCH] don't output the result json when running from an interactive shell. --- js/common/modules/jsunity.js | 10 ++++++++-- js/server/modules/org/arangodb/testing.js | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/js/common/modules/jsunity.js b/js/common/modules/jsunity.js index a3642a3b5b..0b7c936f8d 100644 --- a/js/common/modules/jsunity.js +++ b/js/common/modules/jsunity.js @@ -180,7 +180,7 @@ function Done (suiteName) { /// @brief runs a JSUnity test file //////////////////////////////////////////////////////////////////////////////// -function RunTest (path) { +function RunTest (path, outputReply) { var content; var f; @@ -193,7 +193,13 @@ function RunTest (path) { throw "cannot create context function"; } - return f(path); + var rc = f(path); + if (outputReply === true) { + return rc; + } + else { + return rc.status; + } } // ----------------------------------------------------------------------------- diff --git a/js/server/modules/org/arangodb/testing.js b/js/server/modules/org/arangodb/testing.js index fbdd009056..adfed95b3e 100644 --- a/js/server/modules/org/arangodb/testing.js +++ b/js/server/modules/org/arangodb/testing.js @@ -867,7 +867,7 @@ function runThere (options, instanceInfo, file) { var t; if (file.indexOf("-spec") === -1) { t = 'var runTest = require("jsunity").runTest; '+ - 'return runTest(' + JSON.stringify(file) + ');'; + 'return runTest(' + JSON.stringify(file) + ', true);'; } else { var jasmineReportFormat = options.jasmineReportFormat || 'progress'; @@ -912,7 +912,7 @@ function runHere (options, instanceInfo, file) { try { if (file.indexOf("-spec") === -1) { var runTest = require("jsunity").runTest; - result = runTest(file); + result = runTest(file, true); } else { var jasmineReportFormat = options.jasmineReportFormat || 'progress';