11var levelup = require ( '../lib/levelup' )
22var errors = levelup . errors
3- var async = require ( 'async' )
3+ var each = require ( 'async-each' )
4+ var series = require ( 'run-series' )
45var common = require ( './common' )
56var assert = require ( 'referee' ) . assert
67var refute = require ( 'referee' ) . refute
@@ -18,7 +19,7 @@ buster.testCase('batch()', {
1819 { type : 'put' , key : 'baz' , value : 'abazvalue' }
1920 ] , function ( err ) {
2021 refute ( err )
21- async . forEach ( [ 'foo' , 'bar' , 'baz' ] , function ( key , callback ) {
22+ each ( [ 'foo' , 'bar' , 'baz' ] , function ( key , callback ) {
2223 db . get ( key , function ( err , value ) {
2324 refute ( err )
2425 assert . equals ( value , 'a' + key + 'value' )
@@ -37,7 +38,7 @@ buster.testCase('batch()', {
3738 { type : 'put' , key : 'baz' , value : 'abazvalue' }
3839 ] )
3940 . then ( function ( ) {
40- async . forEach ( [ 'foo' , 'bar' , 'baz' ] , function ( key , callback ) {
41+ each ( [ 'foo' , 'bar' , 'baz' ] , function ( key , callback ) {
4142 db . get ( key , function ( err , value ) {
4243 refute ( err )
4344 assert . equals ( value , 'a' + key + 'value' )
@@ -51,7 +52,7 @@ buster.testCase('batch()', {
5152
5253 'batch() with multiple puts and deletes' : function ( done ) {
5354 this . openTestDatabase ( function ( db ) {
54- async . series ( [
55+ series ( [
5556 function ( callback ) {
5657 db . batch ( [
5758 { type : 'put' , key : '1' , value : 'one' } ,
@@ -70,7 +71,7 @@ buster.testCase('batch()', {
7071 } ,
7172 function ( callback ) {
7273 // these should exist
73- async . forEach ( [ '2' , '3' , 'bar' , 'baz' ] , function ( key , callback ) {
74+ each ( [ '2' , '3' , 'bar' , 'baz' ] , function ( key , callback ) {
7475 db . get ( key , function ( err , value ) {
7576 refute ( err )
7677 refute . isNull ( value )
@@ -80,7 +81,7 @@ buster.testCase('batch()', {
8081 } ,
8182 function ( callback ) {
8283 // these shouldn't exist
83- async . forEach ( [ '1' , 'foo' ] , function ( key , callback ) {
84+ each ( [ '1' , 'foo' ] , function ( key , callback ) {
8485 db . get ( key , function ( err , value ) {
8586 assert ( err )
8687 assert . isInstanceOf ( err , errors . NotFoundError )
@@ -110,7 +111,7 @@ buster.testCase('batch()', {
110111 . write ( function ( err ) {
111112 refute ( err )
112113
113- async . forEach ( [ 'one' , 'three' , '1' , '2' , '3' ] , function ( key , callback ) {
114+ each ( [ 'one' , 'three' , '1' , '2' , '3' ] , function ( key , callback ) {
114115 db . get ( key , function ( err ) {
115116 if ( [ 'one' , 'three' , '1' , '3' ] . indexOf ( key ) > - 1 ) { assert ( err ) } else { refute ( err ) }
116117 callback ( )
@@ -172,7 +173,7 @@ buster.testCase('batch()', {
172173 . del ( '3' )
173174 . write ( )
174175 . then ( function ( ) {
175- async . forEach ( [ 'one' , 'three' , '1' , '2' , '3' ] , function ( key , callback ) {
176+ each ( [ 'one' , 'three' , '1' , '2' , '3' ] , function ( key , callback ) {
176177 db . get ( key , function ( err ) {
177178 if ( [ 'one' , 'three' , '1' , '3' ] . indexOf ( key ) > - 1 ) { assert ( err ) } else { refute ( err ) }
178179 callback ( )
@@ -206,7 +207,7 @@ buster.testCase('batch()', {
206207 'batch() with can manipulate data from put()' : function ( done ) {
207208 // checks encoding and whatnot
208209 this . openTestDatabase ( function ( db ) {
209- async . series (
210+ series (
210211 [
211212 db . put . bind ( db , '1' , 'one' ) ,
212213 db . put . bind ( db , '2' , 'two' ) ,
@@ -222,7 +223,7 @@ buster.testCase('batch()', {
222223 } ,
223224 function ( callback ) {
224225 // these should exist
225- async . forEach ( [ '2' , '3' , 'bar' , 'baz' ] , function ( key , callback ) {
226+ each ( [ '2' , '3' , 'bar' , 'baz' ] , function ( key , callback ) {
226227 db . get ( key , function ( err , value ) {
227228 refute ( err )
228229 refute . isNull ( value )
@@ -232,7 +233,7 @@ buster.testCase('batch()', {
232233 } ,
233234 function ( callback ) {
234235 // these shouldn't exist
235- async . forEach ( [ '1' , 'foo' ] , function ( key , callback ) {
236+ each ( [ '1' , 'foo' ] , function ( key , callback ) {
236237 db . get ( key , function ( err , value ) {
237238 assert ( err )
238239 assert . isInstanceOf ( err , errors . NotFoundError )
@@ -247,7 +248,7 @@ buster.testCase('batch()', {
247248
248249 'batch() data can be read with get() and del()' : function ( done ) {
249250 this . openTestDatabase ( function ( db ) {
250- async . series ( [
251+ series ( [
251252 function ( callback ) {
252253 db . batch ( [
253254 { type : 'put' , key : '1' , value : 'one' } ,
@@ -258,7 +259,7 @@ buster.testCase('batch()', {
258259 db . del . bind ( db , '1' , 'one' ) ,
259260 function ( callback ) {
260261 // these should exist
261- async . forEach ( [ '2' , '3' ] , function ( key , callback ) {
262+ each ( [ '2' , '3' ] , function ( key , callback ) {
262263 db . get ( key , function ( err , value ) {
263264 refute ( err )
264265 refute . isNull ( value )
0 commit comments