summaryrefslogtreecommitdiff
path: root/test/each.js
diff options
context:
space:
mode:
authorSaurav Azad <3856934+sauravazad@users.noreply.github.com>2021-06-29 03:17:36 +0530
committerGitHub <noreply@github.com>2021-06-28 14:47:36 -0700
commit14d4d0f196d9a26801bb261d16105b59292bb03c (patch)
treeed2c644300a8d23902a4fbb1719b748f1cf38487 /test/each.js
parent200cc0088e49e1e1a27cddee0428288d173f48a4 (diff)
downloadasync-14d4d0f196d9a26801bb261d16105b59292bb03c.tar.gz
Improving tests case coverage (#1754)
* Adding test case when invalid callback is provided to each () * adding nyc ignore block * Adding new test cases for drain to be called if empty data is pushed
Diffstat (limited to 'test/each.js')
-rw-r--r--test/each.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/each.js b/test/each.js
index eb12842..7b83476 100644
--- a/test/each.js
+++ b/test/each.js
@@ -96,6 +96,15 @@ describe("each", () => {
async.each([1], eachNoCallbackIteratee.bind(this, done));
});
+ it('each no callback', async (done) => {
+ try {
+ async.each([1], 'INVALID_CALL_BACK', () => {});
+ } catch(err) {
+ expect(err.message).to.equal('expected a function')
+ done()
+ }
+ });
+
it('eachSeries', function(done) {
var args = [];
async.eachSeries([1,3,2], eachIteratee.bind(this, args), (err) => {