@@ -42,6 +42,7 @@ function createErrorMessage( actual, expected ) {
42
42
// TESTS //
43
43
44
44
tape ( 'main export is a function' , function test ( t ) {
45
+ t . ok ( true , __filename ) ;
45
46
t . strictEqual ( typeof compareValues , 'function' , 'main export is a function' ) ;
46
47
t . end ( ) ;
47
48
} ) ;
@@ -300,14 +301,20 @@ tape( 'the function compares a typed array and a corresponding return annotation
300
301
301
302
buf = new Float32Array ( [ 1.0 , - 1.0 , 2.0 , - 2.0 ] ) ;
302
303
actual = new Complex64Array ( buf ) ;
303
- expected = '<Complex64Array>' ;
304
+ expected = '<Complex64Array>[ 1.0, -1.0, 2.0, -2.0 ] ' ;
304
305
t . strictEqual ( compareValues ( actual , expected ) , null , 'returns null' ) ;
305
306
306
307
buf = new Float64Array ( [ 1.0 , - 1.0 , 2.0 , - 2.0 ] ) ;
307
308
actual = new Complex128Array ( buf ) ;
308
- expected = '<Complex128Array>' ;
309
+ expected = '<Complex128Array>[ 1.0, -1.0, 2.0, -2.0 ] ' ;
309
310
t . strictEqual ( compareValues ( actual , expected ) , null , 'returns null' ) ;
310
311
312
+ buf = new Float64Array ( [ 1.0 , - 1.0 , 2.0 , - 2.0 ] ) ;
313
+ actual = new Complex128Array ( buf ) ;
314
+ expected = '<Complex128Array>[ 1.0, 1.0, 2.0, 2.0 ]' ;
315
+ msg = 'Expected array entries [1,1,2,2], but observed [1,-1,2,-2]' ;
316
+ t . strictEqual ( compareValues ( actual , expected ) , msg , 'returns expected message' ) ;
317
+
311
318
t . end ( ) ;
312
319
} ) ;
313
320
@@ -369,7 +376,7 @@ tape( 'the function differentiates between boxed and primitive values', function
369
376
msg = 'Expected a <Number>, but received an unboxed primitive: `2.3`' ;
370
377
t . strictEqual ( compareValues ( actual , expected ) , msg , 'returns expected message' ) ;
371
378
372
- actual = new Number ( 2.3 ) ; // eslint-disable-line no-new-wrappers
379
+ actual = new Number ( 2.3 ) ;
373
380
expected = '<number>' ;
374
381
msg = 'Expected a <number>, but received a boxed primitive: `2.3`' ;
375
382
t . strictEqual ( compareValues ( actual , expected ) , msg , 'returns expected message' ) ;
@@ -393,7 +400,7 @@ tape( 'the function differentiates between boxed and primitive values', function
393
400
msg = 'Expected a <Boolean>, but received an unboxed primitive: `false`' ;
394
401
t . strictEqual ( compareValues ( actual , expected ) , msg , 'returns expected message' ) ;
395
402
396
- actual = new Boolean ( false ) ; // eslint-disable-line no-new-wrappers
403
+ actual = new Boolean ( false ) ;
397
404
expected = '<boolean>' ;
398
405
msg = 'Expected a <boolean>, but received a boxed primitive: `false`' ;
399
406
t . strictEqual ( compareValues ( actual , expected ) , msg , 'returns expected message' ) ;
0 commit comments