11'use strict'
22
3- var test = require ( 'tape' )
4- var packager = require ( '.' )
3+ const test = require ( 'tape' )
4+ const packager = require ( '.' )
55
66test ( 'Level constructor has access to levelup errors' , function ( t ) {
77 function Down ( ) { }
@@ -18,16 +18,16 @@ test('Level constructor relays .destroy and .repair if they exist', function (t)
1818 function test ( method ) {
1919 function Down ( ) { }
2020
21- Down [ method ] = function ( ) {
22- t . same ( [ ] . slice . call ( arguments ) , args , 'supports variadic arguments' )
21+ Down [ method ] = function ( ... actual ) {
22+ t . same ( actual , expected , 'supports variadic arguments' )
2323 }
2424
25- var level = packager ( Down )
26- var args = [ ]
25+ const level = packager ( Down )
26+ const expected = [ ]
2727
28- for ( var i = 0 ; i < 4 ; i ++ ) {
29- args . push ( i )
30- level [ method ] . apply ( level , args )
28+ for ( let i = 0 ; i < 4 ; i ++ ) {
29+ expected . push ( i )
30+ level [ method ] ( ... expected )
3131 }
3232 }
3333} )
@@ -48,7 +48,7 @@ test('Level constructor', function (t) {
4848 }
4949 }
5050 }
51- var levelup = packager ( Down ) ( )
51+ const levelup = packager ( Down ) ( )
5252 t . is ( levelup . options . keyEncoding , 'utf8' )
5353 t . is ( levelup . options . valueEncoding , 'utf8' )
5454} )
@@ -68,7 +68,7 @@ test('Level constructor with location', function (t) {
6868 }
6969 }
7070 }
71- var levelup = packager ( Down ) ( 'location' )
71+ const levelup = packager ( Down ) ( 'location' )
7272 t . is ( levelup . options . keyEncoding , 'utf8' )
7373 t . is ( levelup . options . valueEncoding , 'utf8' )
7474} )
@@ -134,7 +134,7 @@ test('Level constructor with location & callback', function (t) {
134134
135135test ( 'Level constructor with location & options passed to levelup' , function ( t ) {
136136 t . plan ( 4 )
137- var Down = function ( location ) {
137+ const Down = function ( location ) {
138138 t . is ( location , 'location' , 'location is correct' )
139139 return {
140140 open : function ( opts , cb ) {
@@ -147,7 +147,7 @@ test('Level constructor with location & options passed to levelup', function (t)
147147 }
148148 }
149149 }
150- var levelup = packager ( Down ) ( 'location' , {
150+ const levelup = packager ( Down ) ( 'location' , {
151151 keyEncoding : 'binary' ,
152152 valueEncoding : 'binary'
153153 } )
@@ -157,7 +157,7 @@ test('Level constructor with location & options passed to levelup', function (t)
157157
158158test ( 'Level constructor with options passed to levelup' , function ( t ) {
159159 t . plan ( 3 )
160- var Down = function ( ) {
160+ const Down = function ( ) {
161161 return {
162162 open : function ( opts , cb ) {
163163 t . same ( opts , {
@@ -169,7 +169,7 @@ test('Level constructor with options passed to levelup', function (t) {
169169 }
170170 }
171171 }
172- var levelup = packager ( Down ) ( {
172+ const levelup = packager ( Down ) ( {
173173 keyEncoding : 'binary' ,
174174 valueEncoding : 'binary'
175175 } )
@@ -179,7 +179,7 @@ test('Level constructor with options passed to levelup', function (t) {
179179
180180test ( 'Level constructor with options & callback passed to levelup' , function ( t ) {
181181 t . plan ( 5 )
182- var Down = function ( ) {
182+ const Down = function ( ) {
183183 return {
184184 open : function ( opts , cb ) {
185185 t . same ( opts , {
@@ -192,7 +192,7 @@ test('Level constructor with options & callback passed to levelup', function (t)
192192 }
193193 }
194194 }
195- var levelup = packager ( Down ) ( {
195+ const levelup = packager ( Down ) ( {
196196 keyEncoding : 'binary' ,
197197 valueEncoding : 'binary'
198198 } , function ( err , db ) {
0 commit comments