summaryrefslogtreecommitdiff
path: root/test/applyEach.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/applyEach.js')
-rw-r--r--test/applyEach.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/applyEach.js b/test/applyEach.js
index ca5ada3..e164dda 100644
--- a/test/applyEach.js
+++ b/test/applyEach.js
@@ -2,32 +2,32 @@ var async = require('../lib');
var expect = require('chai').expect;
var assert = require('assert');
-describe('applyEach', function () {
+describe('applyEach', () => {
- it('applyEach', function (done) {
+ it('applyEach', (done) => {
var call_order = [];
var one = function (val, cb) {
expect(val).to.equal(5);
- setTimeout(function () {
+ setTimeout(() => {
call_order.push('one');
cb(null, 1);
}, 12);
};
var two = function (val, cb) {
expect(val).to.equal(5);
- setTimeout(function () {
+ setTimeout(() => {
call_order.push('two');
cb(null, 2);
}, 2);
};
var three = function (val, cb) {
expect(val).to.equal(5);
- setTimeout(function () {
+ setTimeout(() => {
call_order.push('three');
cb(null, 3);
}, 18);
};
- async.applyEach([one, two, three], 5, function (err, results) {
+ async.applyEach([one, two, three], 5, (err, results) => {
assert(err === null, err + " passed instead of 'null'");
expect(call_order).to.eql(['two', 'one', 'three']);
expect(results).to.eql([1, 2, 3]);
@@ -35,30 +35,30 @@ describe('applyEach', function () {
});
});
- it('applyEachSeries', function (done) {
+ it('applyEachSeries', (done) => {
var call_order = [];
var one = function (val, cb) {
expect(val).to.equal(5);
- setTimeout(function () {
+ setTimeout(() => {
call_order.push('one');
cb(null, 1);
}, 10);
};
var two = function (val, cb) {
expect(val).to.equal(5);
- setTimeout(function () {
+ setTimeout(() => {
call_order.push('two');
cb(null, 2);
}, 5);
};
var three = function (val, cb) {
expect(val).to.equal(5);
- setTimeout(function () {
+ setTimeout(() => {
call_order.push('three');
cb(null, 3);
}, 15);
};
- async.applyEachSeries([one, two, three], 5, function (err, results) {
+ async.applyEachSeries([one, two, three], 5, (err, results) => {
assert(err === null, err + " passed instead of 'null'");
expect(call_order).to.eql(['one', 'two', 'three']);
expect(results).to.eql([1, 2, 3]);
@@ -66,30 +66,30 @@ describe('applyEach', function () {
});
});
- it('applyEach partial application', function (done) {
+ it('applyEach partial application', (done) => {
var call_order = [];
var one = function (val, cb) {
expect(val).to.equal(5);
- setTimeout(function () {
+ setTimeout(() => {
call_order.push('one');
cb(null, 1);
}, 10);
};
var two = function (val, cb) {
expect(val).to.equal(5);
- setTimeout(function () {
+ setTimeout(() => {
call_order.push('two');
cb(null, 2);
}, 5);
};
var three = function (val, cb) {
expect(val).to.equal(5);
- setTimeout(function () {
+ setTimeout(() => {
call_order.push('three');
cb(null, 3);
}, 15);
};
- async.applyEach([one, two, three])(5, function (err, results) {
+ async.applyEach([one, two, three])(5, (err, results) => {
if (err) throw err;
expect(call_order).to.eql(['two', 'one', 'three']);
expect(results).to.eql([1, 2, 3]);