summaryrefslogtreecommitdiff
path: root/test/es2017/awaitableFunctions.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/es2017/awaitableFunctions.js')
-rw-r--r--test/es2017/awaitableFunctions.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/es2017/awaitableFunctions.js b/test/es2017/awaitableFunctions.js
index f9a64e3..156df08 100644
--- a/test/es2017/awaitableFunctions.js
+++ b/test/es2017/awaitableFunctions.js
@@ -253,4 +253,31 @@ module.exports = function () {
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]])
+ });
};