From 210de70d6d594a4c50bc4fe87b16cd8b8eba6f59 Mon Sep 17 00:00:00 2001 From: ezubarev Date: Sun, 8 May 2016 00:03:49 +0600 Subject: Fix test on asyncify with variable numbers of arguments --- mocha_test/asyncify.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/mocha_test/asyncify.js b/mocha_test/asyncify.js index 587ca32..b171e86 100644 --- a/mocha_test/asyncify.js +++ b/mocha_test/asyncify.js @@ -1,5 +1,6 @@ var async = require('../lib'); var assert = require('assert'); +var expect = require('chai').expect; var isBrowser = require('./support/is_browser'); describe('asyncify', function(done){ @@ -25,14 +26,16 @@ describe('asyncify', function(done){ }); it('variable numbers of arguments', function(done) { - async.asyncify(function (x, y, z) { - assert(arguments.length === 3); - assert(x === 1); - assert(y === 2); - assert(z === 3); - })(1, 2, 3, function () {}); - done(); - }); + async.asyncify(function (x, y, z) { + return arguments; + })(1, 2, 3, function (err, result) { + expect(result.length).to.equal(3); + expect(result[0]).to.equal(1); + expect(result[1]).to.equal(2); + expect(result[2]).to.equal(3); + done(); + }); + }); it('catch errors', function(done) { async.asyncify(function () { -- cgit v1.2.1