Permalink
Browse files

Updated tests to not use process.loop

  • Loading branch information...
1 parent 8310442 commit 25df69972b9dfe823cdf74661047ea1ff6481833 Danny Brain committed Sep 21, 2010
Showing with 7 additions and 6 deletions.
  1. +7 −6 test/all.js
View
13 test/all.js
@@ -2,6 +2,8 @@ var assert = require("assert");
var jazz = require("../lib/jazz");
var sys = require("sys");
+sys.puts("Running tests ...");
+
function Muffin(numberOfBites) {
this._numberOfBites = numberOfBites;
};
@@ -152,8 +154,8 @@ var testCases = [
[{pewpew: {maximum: 5, numberOfLegs: 2, numberOfEars: 2}, megaMuffin: function(hash, cb) { cb(hash['size'] + hash['legs']); }}, "7"]],
["{captainAmerica({'wow': true, 'notwow': false})}",
[{captainAmerica: function(hash, cb) { if (hash['wow'] && !hash['notwow']) { cb("yay"); } else { cb("daww"); }}}, "yay" ]],
- ["{foreach a in sambuca}{a}{end}",
- [{}, ""]]
+ ["{foreach a in sambuca}{a}{end}a",
+ [{}, "a"]]
];
testCases.forEach(function(testCase) {
@@ -163,14 +165,13 @@ testCases.forEach(function(testCase) {
var params = tests[i][0] || {};
var expected = tests[i][1] || "";
var options = tests[i][2] || {};
-
var template = jazz.compile(source, options);
template.process(params, function(output) {
assert.equal(output, expected);
});
})();
});
-process.loop();
-sys.puts("OK!");
-
+process.on('exit', function() {
+ sys.puts("OK!");
+});

0 comments on commit 25df699

Please sign in to comment.