-
-
Save tobie/4713821 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function load(fixtures, onComplete) { | |
async.parallel(fixtures.map(function(fixture) { | |
return function(cb) { | |
store(fixture, function(err, result) { | |
cb(err, result); | |
}); | |
}; | |
}), onComplete); | |
} | |
describe("moods tests", function() { | |
var moods = [ | |
"2013-02-01:n1k0:sunny" | |
, "2013-02-02:n1k0:cloudy" | |
, "2013-02-03:n1k0:stormy" | |
, "2013-02-04:n1k0:rainy" | |
// … we could add many more | |
]; | |
it ("should do something useful with moods", function(done) { | |
load(moods, function(err, storedMoods) { | |
done(err || undefined); // to make a fair comparison | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function load(fixtures) { | |
return Q.all(fixtures.map(store)); | |
} | |
describe("moods tests", function() { | |
var moods = [ | |
"2013-02-01:n1k0:sunny" | |
, "2013-02-02:n1k0:cloudy" | |
, "2013-02-03:n1k0:stormy" | |
, "2013-02-04:n1k0:rainy" | |
// … we could add many more | |
]; | |
// a promise-freindly test framework would expect promises to be returned | |
it ("should do something useful with moods", function() { | |
return load(moods); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment