summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2020-02-23 18:55:59 -0800
committerAlexander Early <alexander.early@gmail.com>2020-02-23 18:55:59 -0800
commit2130a8245338a6e8e53a269aa3b48e1c8f8a54a3 (patch)
treebf137fe111be62fd96d939c7d53681ca133d8621
parent0e4087b3c28a25152327594f8932277169b7ad43 (diff)
downloadasync-2130a8245338a6e8e53a269aa3b48e1c8f8a54a3.tar.gz
fix tests related to wrapped function names
-rw-r--r--test/es2017/awaitableFunctions.js60
1 files changed, 0 insertions, 60 deletions
diff --git a/test/es2017/awaitableFunctions.js b/test/es2017/awaitableFunctions.js
index de54e8f..f961857 100644
--- a/test/es2017/awaitableFunctions.js
+++ b/test/es2017/awaitableFunctions.js
@@ -50,172 +50,145 @@ module.exports = function () {
*/
it('should return a Promise: each', async () => {
- expect (async.each.name).to.contain('each')
const calls = []
await async.each(input, async val => { calls.push(val) });
expect(calls).to.eql([1, 2, 3])
expect(async.each(input, asyncIdentity) instanceof Promise).to.equal(true)
});
it('should return a Promise: eachSeries', async () => {
- expect (async.eachSeries.name).to.contain('eachSeries')
const calls = []
await async.eachSeries(input, async val => { calls.push(val) });
expect(calls).to.eql([1, 2, 3])
});
it('should return a Promise: eachLimit', async () => {
- expect (async.eachLimit.name).to.contain('eachLimit')
const calls = []
await async.eachLimit(input, 1, async val => { calls.push(val) });
expect(calls).to.eql([1, 2, 3])
});
it('should return a Promise: eachOf', async () => {
- expect (async.eachOf.name).to.contain('eachOf')
const calls = []
await async.eachOf(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1, 'a'], [2, 'b'], [3, 'c']])
});
it('should return a Promise: eachOfSeries', async () => {
- expect (async.eachOfSeries.name).to.contain('eachOfSeries')
const calls = []
await async.eachOfSeries(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1, 'a'], [2, 'b'], [3, 'c']])
});
it('should return a Promise: eachOfLimit', async () => {
- expect (async.eachOfLimit.name).to.contain('eachOfLimit')
const calls = []
await async.eachOfLimit(inputObj, 1, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1, 'a'], [2, 'b'], [3, 'c']])
});
it('should return a Promise: concat', async () => {
- expect (async.concat.name).to.contain('concat')
const calls = []
await async.concat(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: concatSeries', async () => {
- expect (async.concatSeries.name).to.contain('concatSeries')
const calls = []
await async.concatSeries(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: concatLimit', async () => {
- expect (async.concatLimit.name).to.contain('concatLimit')
const calls = []
await async.concatLimit(inputObj, 1, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: detect', async () => {
- expect (async.detect.name).to.contain('detect')
const calls = []
await async.detect(input, async (...args) => { calls.push(args); return args[0] === 3 });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: detectSeries', async () => {
- expect (async.detectSeries.name).to.contain('detectSeries')
const calls = []
await async.detectSeries(input, async (...args) => { calls.push(args); return args[0] === 3 });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: detectLimit', async () => {
- expect (async.detectLimit.name).to.contain('detectLimit')
const calls = []
await async.detectLimit(input, 1, async (...args) => { calls.push(args); return args[0] === 3 });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: every', async () => {
- expect (async.every.name).to.contain('every')
const calls = []
await async.every(input, async (...args) => { calls.push(args); return args[0] !== 3 });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: everySeries', async () => {
- expect (async.everySeries.name).to.contain('everySeries')
const calls = []
await async.everySeries(input, async (...args) => { calls.push(args); return args[0] !== 3 });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: everyLimit', async () => {
- expect (async.everyLimit.name).to.contain('everyLimit')
const calls = []
await async.everyLimit(input, 1, async (...args) => { calls.push(args); return args[0] !== 3 });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: filter', async () => {
- expect (async.filter.name).to.contain('filter')
const calls = []
await async.filter(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: filterSeries', async () => {
- expect (async.filterSeries.name).to.contain('filterSeries')
const calls = []
await async.filterSeries(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: filterLimit', async () => {
- expect (async.filterLimit.name).to.contain('filterLimit')
const calls = []
await async.filterLimit(inputObj, 1, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: groupBy', async () => {
- expect (async.groupBy.name).to.contain('groupBy')
const calls = []
await async.groupBy(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: groupBySeries', async () => {
- expect (async.groupBySeries.name).to.contain('groupBySeries')
const calls = []
await async.groupBySeries(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: groupByLimit', async () => {
- expect (async.groupByLimit.name).to.contain('groupByLimit')
const calls = []
await async.groupByLimit(inputObj, 1, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: map', async () => {
- expect (async.map.name).to.contain('map')
const calls = []
await async.map(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: mapSeries', async () => {
- expect (async.mapSeries.name).to.contain('mapSeries')
const calls = []
await async.mapSeries(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: mapLimit', async () => {
- expect (async.mapLimit.name).to.contain('mapLimit')
const calls = []
await async.mapLimit(inputObj, 1, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: mapValues', async () => {
- expect (async.mapValues.name).to.contain('mapValues')
const calls = []
await async.mapValues(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1, 'a'], [2, 'b'], [3, 'c']])
});
it('should return a Promise: mapValuesSeries', async () => {
- expect (async.mapValuesSeries.name).to.contain('mapValuesSeries')
const calls = []
await async.mapValuesSeries(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1, 'a'], [2, 'b'], [3, 'c']])
});
it('should return a Promise: mapValuesLimit', async () => {
- expect (async.mapValuesLimit.name).to.contain('mapValuesLimit')
const calls = []
await async.mapValuesLimit(inputObj, 1, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1, 'a'], [2, 'b'], [3, 'c']])
@@ -223,90 +196,76 @@ module.exports = function () {
it('should return a Promise: reduce', async () => {
- expect (async.reduce.name).to.contain('reduce')
const calls = []
await async.reduce(input, 1, async (...args) => calls.push(args));
expect(calls).to.eql([[1, 1], [1, 2], [2, 3]])
});
it('should return a Promise: reduceRight', async () => {
- expect (async.reduceRight.name).to.contain('reduceRight')
const calls = []
await async.reduceRight(input, 1, async (...args) => calls.push(args));
expect(calls).to.eql([[1, 3], [1, 2], [2, 1]])
});
it('should return a Promise: reject', async () => {
- expect (async.reject.name).to.contain('reject')
const calls = []
await async.reject(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: rejectSeries', async () => {
- expect (async.rejectSeries.name).to.contain('rejectSeries')
const calls = []
await async.rejectSeries(inputObj, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: rejectLimit', async () => {
- expect (async.rejectLimit.name).to.contain('rejectLimit')
const calls = []
await async.rejectLimit(inputObj, 1, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: some', async () => {
- expect (async.some.name).to.contain('some')
const calls = []
await async.some(input, async (...args) => { calls.push(args); return args[0] === 3 });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: someSeries', async () => {
- expect (async.someSeries.name).to.contain('someSeries')
const calls = []
await async.someSeries(input, async (...args) => { calls.push(args); return args[0] === 3 });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: someLimit', async () => {
- expect (async.someLimit.name).to.contain('someLimit')
const calls = []
await async.someLimit(input, 1, async (...args) => { calls.push(args); return args[0] === 3 });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: sortBy', async () => {
- expect (async.sortBy.name).to.contain('sortBy')
const calls = []
await async.sortBy(input, async (...args) => { calls.push(args) });
expect(calls).to.eql([[1], [2], [3]])
});
it('should return a Promise: times', async () => {
- expect (async.times.name).to.contain('times')
const calls = []
await async.times(3, async (...args) => { calls.push(args); return args[0] === 3 });
expect(calls).to.eql([[0], [1], [2]])
});
it('should return a Promise: timesSeries', async () => {
- expect (async.timesSeries.name).to.contain('timesSeries')
const calls = []
await async.timesSeries(3, async (...args) => { calls.push(args); return args[0] === 3 });
expect(calls).to.eql([[0], [1], [2]])
});
it('should return a Promise: timesLimit', async () => {
- expect (async.timesLimit.name).to.contain('timesLimit')
const calls = []
await async.timesLimit(3, 1, async (...args) => { calls.push(args); return args[0] === 3 });
expect(calls).to.eql([[0], [1], [2]])
});
it('should return a Promise: transform', async () => {
- expect (async.transform.name).to.contain('transform')
const calls = []
await async.transform(inputObj, 1, async (...args) => calls.push(args));
expect(calls).to.eql([[1, 1, 'a'], [1, 2, 'b'], [1, 3, 'c']])
});
it('should return a Promise: transform (2 args)', async () => {
- expect (async.transform.name).to.contain('transform')
const calls = []
await async.transform(inputObj, async (...args) => calls.push(args));
expect(calls).to.eql([[{}, 1, 'a'], [{}, 2, 'b'], [{}, 3, 'c']])
@@ -334,7 +293,6 @@ module.exports = function () {
})
it('should return a Promise: auto', async () => {
- expect (async.auto.name).to.contain('auto')
const calls = []
await async.auto({
async a () {
@@ -351,7 +309,6 @@ module.exports = function () {
expect(calls).to.eql(['a', 'c', 'b'])
});
it('should return a Promise: autoInject', async () => {
- expect (async.autoInject.name).to.contain('autoInject')
const calls = []
await async.autoInject({
async a () {
@@ -368,7 +325,6 @@ module.exports = function () {
});
it('should return a Promise: compose', async () => {
- expect (async.compose.name).to.contain('compose')
const calls = []
const fn = async.compose(
async (...args) => calls.push('a', args),
@@ -379,7 +335,6 @@ module.exports = function () {
expect(result).to.eql(4)
});
it('should return a Promise: seq', async () => {
- expect (async.seq.name).to.contain('seq')
const calls = []
const fn = async.seq(
async (...args) => calls.push('a', args),
@@ -391,7 +346,6 @@ module.exports = function () {
});
it('should return a Promise: whilst', async () => {
- expect (async.whilst.name).to.contain('whilst')
const calls = []
let counter = 0
await async.whilst(
@@ -408,7 +362,6 @@ module.exports = function () {
])
});
it('should return a Promise: until', async () => {
- expect (async.until.name).to.contain('until')
const calls = []
let counter = 0
await async.until(
@@ -425,7 +378,6 @@ module.exports = function () {
])
});
it('should return a Promise: doWhilst', async () => {
- expect (async.doWhilst.name).to.contain('doWhilst')
const calls = []
let counter = 0
await async.doWhilst(
@@ -442,7 +394,6 @@ module.exports = function () {
])
});
it('should return a Promise: doUntil', async () => {
- expect (async.doUntil.name).to.contain('doUntil')
const calls = []
let counter = 0
await async.doUntil(
@@ -460,7 +411,6 @@ module.exports = function () {
});
it('should return a Promise: forever', async () => {
- expect (async.forever.name).to.contain('forever')
const calls = []
let counter = 0
try {
@@ -478,7 +428,6 @@ module.exports = function () {
});
it('should return a Promise: parallel', async () => {
- expect (async.parallel.name).to.contain('parallel')
const calls = []
await async.parallel([
async () => { await Promise.resolve(); calls.push(1) },
@@ -489,7 +438,6 @@ module.exports = function () {
expect(calls).to.eql([1, 1, 1, 1])
});
it('should return a Promise: parallelLimit', async () => {
- expect (async.parallelLimit.name).to.contain('parallelLimit')
const calls = []
await async.parallelLimit([
async () => { await Promise.resolve(); calls.push(1) },
@@ -500,7 +448,6 @@ module.exports = function () {
expect(calls).to.eql([1, 1, 1, 1])
});
it('should return a Promise: series', async () => {
- expect (async.series.name).to.contain('series')
const calls = []
await async.series([
async () => { await Promise.resolve(); calls.push(1) },
@@ -512,7 +459,6 @@ module.exports = function () {
});
it('should return a Promise: race', async () => {
- expect (async.race.name).to.contain('race')
const calls = []
await async.race([
async () => { await Promise.resolve(); calls.push(1) },
@@ -524,7 +470,6 @@ module.exports = function () {
});
it('should return a Promise: retryable', async () => {
- expect (async.retryable.name).to.contain('retryable')
let counter = 0
const calls = []
const fn = async.retryable(async (a, b) => {
@@ -538,7 +483,6 @@ module.exports = function () {
expect(calls).to.eql([1, 2, 1, 2, 1, 2])
});
it('should return a Promise: retryable (arity 0)', async () => {
- expect (async.retryable.name).to.contain('retryable')
let counter = 0
const calls = []
const fn = async.retryable({times: 5}, async () => {
@@ -551,7 +495,6 @@ module.exports = function () {
});
it('should return a Promise: retry', async () => {
- expect (async.retry.name).to.contain('retry')
let counter = 0
const calls = []
await async.retry(async () => {
@@ -563,7 +506,6 @@ module.exports = function () {
});
it('should return a Promise: retry (multiple cb args)', async () => {
- expect (async.retry.name).to.contain('retry')
let counter = 0
const results = await async.retry((cb) => {
counter++
@@ -574,7 +516,6 @@ module.exports = function () {
});
it('should return a Promise: tryEach', async () => {
- expect (async.tryEach.name).to.contain('tryEach')
const calls = []
await async.tryEach([
async () => { await Promise.resolve(); calls.push(1); throw new Error() },
@@ -586,7 +527,6 @@ module.exports = function () {
});
it('should return a Promise: waterfall', async () => {
- expect (async.waterfall.name).to.contain('waterfall')
const calls = []
await async.waterfall([
async () => { await Promise.resolve(); calls.push(1) },