summaryrefslogtreecommitdiff
path: root/mocha_test/autoInject.js
diff options
context:
space:
mode:
authorSteve Robb <softnfuzzyrobb@gmail.com>2016-04-26 08:05:43 +0100
committerSteve Robb <softnfuzzyrobb@gmail.com>2016-04-26 08:05:43 +0100
commita35af5192ffbe1215376dde7e8adfe277603643e (patch)
tree54bc905ae1f15422845b189e87f7ae16ae8e8390 /mocha_test/autoInject.js
parent3b0d9bd039266d6b3f9603d4bc30aae8307becc6 (diff)
parenta50b252794979c66ecb75e8f33cac882c1019ef0 (diff)
downloadasync-a35af5192ffbe1215376dde7e8adfe277603643e.tar.gz
Merge branch 'master' into es6arrows
Diffstat (limited to 'mocha_test/autoInject.js')
-rw-r--r--mocha_test/autoInject.js28
1 files changed, 5 insertions, 23 deletions
diff --git a/mocha_test/autoInject.js b/mocha_test/autoInject.js
index 39c68cd..e548d91 100644
--- a/mocha_test/autoInject.js
+++ b/mocha_test/autoInject.js
@@ -44,8 +44,8 @@ describe('autoInject', function () {
callback(null, 6);
}
},
- function(err, task6){
- expect(task6).to.equal(6);
+ function(err, results){
+ expect(results.task6).to.equal(6);
expect(callOrder).to.eql(['task2','task3','task6','task5','task1','task4']);
done();
});
@@ -74,33 +74,15 @@ describe('autoInject', function () {
});
});
- it('should work with array results', function (done) {
- async.autoInject({
- task1: function (cb) {
- cb(null, 1);
- },
- task2: function (task3, cb) {
- cb(null, 2);
- },
- task3: function (cb) {
- cb(null, 3);
- }
- }, ['task3', 'task1', function (err, task3, task1) {
- expect(task1).to.equal(1);
- expect(task3).to.equal(3);
- done();
- }]);
- });
-
// Needs to be run on ES6 only - not sure how you plan to handle this
// it('should work with es6 arrow syntax', function (done) {
// async.autoInject({
// task1: (cb) => cb(null, 1),
// task2: (task3, cb) => cb(null, 2),
// task3: cb => cb(null, 3)
- // }, (err, task3, task1) => {
- // expect(task1).to.equal(1);
- // expect(task3).to.equal(3);
+ // }, (err, results) => {
+ // expect(results.task1).to.equal(1);
+ // expect(results.task3).to.equal(3);
// done();
// });
// });