diff options
author | Alexander Early <alexander.early@gmail.com> | 2017-10-15 15:04:38 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2017-10-15 15:04:38 -0700 |
commit | 163a251063eb5504a4b8e9ea1b1a6c854b345f86 (patch) | |
tree | 47b1d7fe718088ce645689321daed0540784fbdd | |
parent | 95f9dc7f57133d5d634c3e470147a9427588c0fb (diff) | |
download | async-163a251063eb5504a4b8e9ea1b1a6c854b345f86.tar.gz |
add tests
-rw-r--r-- | support/build.test.js | 5 | ||||
-rw-r--r-- | support/es.test.js | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/support/build.test.js b/support/build.test.js index cc56348..c0c939d 100644 --- a/support/build.test.js +++ b/support/build.test.js @@ -1,5 +1,5 @@ // Smoke test for the CJS build -var methods = ["each", "waterfall", "queue", "eachSeries"]; +var methods = ["each", "waterfall", "queue", "eachSeries", "forEachOf"]; var expect = require('chai').expect; var rollup = require('rollup').rollup; var rollupPluginNodeResolve = require('rollup-plugin-node-resolve'); @@ -48,7 +48,8 @@ describe("async umd minified", function() { }); }); -methods.forEach(function (methodName) { +// TODO: don't slice when we can make individual files for aliases +methods.slice(0, -1).forEach(function (methodName) { describe("async." + methodName, function () { var method; before(function () { diff --git a/support/es.test.js b/support/es.test.js index 9f7fd5e..da008fa 100644 --- a/support/es.test.js +++ b/support/es.test.js @@ -1,6 +1,7 @@ // simple async example to test ES module build output import {waterfall as waterfall} from "../build-es/index"; +import {wrapSync} from "../build-es/index"; import async from "../build-es/index"; import constant from "../build-es/constant"; @@ -10,6 +11,13 @@ waterfall([ async.setImmediate(function () { next(null, val); }); + }, + wrapSync(function (a) { return a; }), + function (val, next) { + async.forEachOf({a: 1}, function (val, key, cb) { + if (val !== 1 && key !== 'a') return cb(new Error('fail!')); + cb(); + }, function (err) { next (err, val)}); } ], function (err, result) { if (err) { throw err; } |