@@ -202,7 +202,9 @@ function checkForPlaceholders( actual, expected ) {
202
202
case '<RangeError>' :
203
203
return isRangeError ( actual ) ;
204
204
default :
205
- // Uknown type, let it slide...
205
+ // Unknown type, let it slide...
206
+
207
+ // FIXME: should we compare constructor names here at a minimum?
206
208
return true ;
207
209
}
208
210
}
@@ -385,28 +387,32 @@ function compareValues( actual, expected ) {
385
387
if ( ! checkPrimitive ( actual , expected ) ) {
386
388
return 'Displayed return value is `' + expected + '`, but expected `' + actual + '` instead' ;
387
389
}
390
+ return null ;
388
391
}
389
- else if ( isTypedArray ( actual ) ) {
392
+ if ( isTypedArray ( actual ) ) {
390
393
return checkTypedArrays ( actual , expected ) ;
391
394
}
392
395
if ( isArray ( actual ) ) {
393
396
if ( ! checkArray ( actual , expected ) ) {
394
397
return 'Displayed return value is `' + expected + '`, but expected `' + createAnnotationValue ( actual ) + '` instead' ;
395
398
}
399
+ return null ;
396
400
}
397
- else if ( isRegExp ( actual ) ) {
401
+ if ( isRegExp ( actual ) ) {
398
402
actual = actual . toString ( ) ;
399
403
if ( actual !== expected ) {
400
404
return 'Displayed return value is `' + expected + '`, but expected `' + actual + '` instead' ;
401
405
}
406
+ return null ;
402
407
}
403
- else if ( isFunction ( actual ) ) {
408
+ if ( isFunction ( actual ) ) {
404
409
actual = actual . toString ( ) ;
405
410
if ( actual !== expected ) {
406
411
return 'Displayed return value is `' + expected + '`, but expected `' + actual + '` instead' ;
407
412
}
413
+ return null ;
408
414
}
409
- else if ( isObjectLike ( actual ) ) {
415
+ if ( isObjectLike ( actual ) ) {
410
416
if ( ! contains ( expected , '...' ) ) {
411
417
try {
412
418
expectedValue = parse ( expected ) ;
@@ -419,6 +425,7 @@ function compareValues( actual, expected ) {
419
425
return 'Displayed return value is `' + expected + '`, but expected `' + actualString + '` instead' ;
420
426
}
421
427
}
428
+ return null ;
422
429
}
423
430
return null ;
424
431
}
0 commit comments