[Pkg-javascript-commits] [less.js] 21/38: Fix testing framework - was skipping some tests.

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:27:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.2.0
in repository less.js.

commit 52a3790569cf2317932a94b55848156fd69ea670
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sat Jan 3 09:03:08 2015 +0000

    Fix testing framework - was skipping some tests.
---
 test/less-test.js | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/test/less-test.js b/test/less-test.js
index 2020a5c..9d7ecef 100644
--- a/test/less-test.js
+++ b/test/less-test.js
@@ -44,14 +44,12 @@ module.exports = function() {
         } else {
             queueRunning = false;
         }
-    };
-
+    }
 
     var totalTests = 0,
         failedTests = 0,
         passedTests = 0;
 
-
     less.functions.functionRegistry.addMultiple({
         add: function (a, b) {
             return new(less.tree.Dimension)(a.value + b.value);
@@ -122,9 +120,9 @@ module.exports = function() {
     }
 
     function testSyncronous(options, filenameNoExtension) {
+		totalTests++;
         queue(function() {
         var isSync = true;
-        totalTests++;
         toCSS(options, path.join('test/less/', filenameNoExtension + ".less"), function (err, result) {
             process.stdout.write("- Test Sync " + filenameNoExtension + ": ");
 
@@ -176,7 +174,9 @@ module.exports = function() {
             toCSS(options, path.join('test/less/', foldername + file), function (err, result) {
 
                 if (verifyFunction) {
-                    return verifyFunction(name, err, result && result.css, doReplacements, result && result.map);
+                    var verificationResult = verifyFunction(name, err, result && result.css, doReplacements, result && result.map);
+	                release();
+	                return verificationResult;
                 }
                 if (err) {
                     fail("ERROR: " + (err && err.message));
@@ -238,6 +238,7 @@ module.exports = function() {
 
     function endTest() {
         var leaked = checkGlobalLeaks();
+
         if (failedTests + passedTests === totalTests) {
             process.stdout.write("\n");
             if (failedTests > 0) {
@@ -251,8 +252,8 @@ module.exports = function() {
             }
 
             if (leaked.length || failedTests) {
-                //process.exit(1);
-                process.on('exit', function() { process.reallyExit(1) });
+                process.exit(1);
+                process.on('exit', function() { process.reallyExit(1); });
             }
         }
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list