diff options
author | Alex Early <alexander.early@gmail.com> | 2018-07-08 16:58:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-08 16:58:36 -0700 |
commit | e4751178540a3c6e64598b93977481ec599704d2 (patch) | |
tree | dce5731bdb1076971d2e4a0a42fbe0d95c720185 /test/sortBy.js | |
parent | 6405b109fe60541ff42d7638ac891d321d6a7bb3 (diff) | |
download | async-e4751178540a3c6e64598b93977481ec599704d2.tar.gz |
ES6-ify codebase (#1553)
* cancelable foreach
* cancelable waterfall
* cancellable auto
* fix lint
* fix tests
* cancelable whilst/until/during/forever
* fix waterfall test. It WILL get there
* docs
* use rest params instead of slice
* clean up internals
* remove property func
* clarify uses of createTester
* happy path async funtions in asyncify
* stop using arguments
* DLL to class
* moar arrows
* fix merge issues
* remove forOwn
* moar arrows
* fix merge mistake
* even more arrows, what can stop him
* mo more fn.apply(null,...)
* remove more spurious uses of apply
* update lint config
* just when you thought there couldn't possibly be more arrows
* use eslint:recommended
* even less uses or aguments
* get rid of prototype cuteness
* fix concat tests
* fix more tests
Diffstat (limited to 'test/sortBy.js')
-rw-r--r-- | test/sortBy.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/sortBy.js b/test/sortBy.js index 1636276..1d2de82 100644 --- a/test/sortBy.js +++ b/test/sortBy.js @@ -2,33 +2,33 @@ var async = require('../lib'); var expect = require('chai').expect; var assert = require('assert'); -describe('sortBy', function(){ - it('sortBy', function(done) { - async.sortBy([{a:1},{a:15},{a:6}], function(x, callback){ - setTimeout(function(){callback(null, x.a);}, 0); - }, function(err, result){ +describe('sortBy', () => { + it('sortBy', (done) => { + async.sortBy([{a:1},{a:15},{a:6}], (x, callback) => { + setTimeout(() => {callback(null, x.a);}, 0); + }, (err, result) => { assert(err === null, err + " passed instead of 'null'"); expect(result).to.eql([{a:1},{a:6},{a:15}]); done(); }); }); - it('sortBy inverted', function(done) { - async.sortBy([{a:1},{a:15},{a:6}], function(x, callback){ - setTimeout(function(){callback(null, x.a*-1);}, 0); - }, function(err, result){ + it('sortBy inverted', (done) => { + async.sortBy([{a:1},{a:15},{a:6}], (x, callback) => { + setTimeout(() => {callback(null, x.a*-1);}, 0); + }, (err, result) => { expect(result).to.eql([{a:15},{a:6},{a:1}]); done(); }); }); - it('sortBy error', function(done) { + it('sortBy error', (done) => { var error = new Error('asdas'); - async.sortBy([{a:1},{a:15},{a:6}], function(x, callback){ - async.setImmediate(function(){ + async.sortBy([{a:1},{a:15},{a:6}], (x, callback) => { + async.setImmediate(() => { callback(error); }); - }, function(err){ + }, (err) => { expect(err).to.equal(error); done(); }); |