@@ -233,6 +233,9 @@ describe('assert', function () {
233
233
assert . deepEqual ( { tea : 'chai' } , { tea : 'chai' } ) ;
234
234
assert . deepStrictEqual ( { tea : 'chai' } , { tea : 'chai' } ) ; // Alias of deepEqual
235
235
236
+ assert . deepEqual ( [ NaN ] , [ NaN ] ) ;
237
+ assert . deepEqual ( { tea : NaN } , { tea : NaN } ) ;
238
+
236
239
err ( function ( ) {
237
240
assert . deepEqual ( { tea : 'chai' } , { tea : 'black' } ) ;
238
241
} , "expected { tea: \'chai\' } to deeply equal { tea: \'black\' }" ) ;
@@ -329,7 +332,19 @@ describe('assert', function () {
329
332
} ) ;
330
333
331
334
it ( 'isNaN' , function ( ) {
332
- assert . isNaN ( 'hello' ) ;
335
+ assert . isNaN ( NaN ) ;
336
+
337
+ err ( function ( ) {
338
+ assert . isNaN ( Infinity ) ;
339
+ } , "expected Infinity to be NaN" ) ;
340
+
341
+ err ( function ( ) {
342
+ assert . isNaN ( undefined ) ;
343
+ } , "expected undefined to be NaN" ) ;
344
+
345
+ err ( function ( ) {
346
+ assert . isNaN ( { } ) ;
347
+ } , "expected {} to be NaN" ) ;
333
348
334
349
err ( function ( ) {
335
350
assert . isNaN ( 4 ) ;
@@ -338,10 +353,13 @@ describe('assert', function () {
338
353
339
354
it ( 'isNotNaN' , function ( ) {
340
355
assert . isNotNaN ( 4 ) ;
356
+ assert . isNotNaN ( Infinity ) ;
357
+ assert . isNotNaN ( undefined ) ;
358
+ assert . isNotNaN ( { } ) ;
341
359
342
360
err ( function ( ) {
343
- assert . isNotNaN ( 'hello' ) ;
344
- } , "expected 'hello' not to be NaN" ) ;
361
+ assert . isNotNaN ( NaN ) ;
362
+ } , "expected NaN not to be NaN" ) ;
345
363
} ) ;
346
364
347
365
it ( 'exists' , function ( ) {
0 commit comments