Skip to content

Instantly share code, notes, and snippets.

@nicokruger
Created February 29, 2012 07:21
Show Gist options
  • Select an option

  • Save nicokruger/1938833 to your computer and use it in GitHub Desktop.

Select an option

Save nicokruger/1938833 to your computer and use it in GitHub Desktop.
synchelper-test.js
ar _ = require("underscore"),
assert = require("assert"),
synchelper = require("../js/synchelper.js");
describe("Sync helper", function () {
it("should preserve the arguments", function (done) {
synchelper.waitForAll(
done,
function (callback) {
callback(1);
},
function (callback, x) {
assert.equal(1, x);
callback(3, 4);
},
function (callback, a, b) {
assert.equal(3, a);
assert.equal(4, b);
callback(100, 101, 102);
},
function (callback, x, y, z) {
assert.equal(100, x);
assert.equal(101, y);
assert.equal(102, z);
callback();
}
);
}) ;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment