@@ -43,18 +43,18 @@ are evaluated also:
43
43
const assert = require (' assert' );
44
44
45
45
const obj1 = {
46
- a : {
47
- b : 1
46
+ a: {
47
+ b: 1
48
48
}
49
49
};
50
50
const obj2 = {
51
- a : {
52
- b : 2
51
+ a: {
52
+ b: 2
53
53
}
54
54
};
55
55
const obj3 = {
56
- a : {
57
- b : 1
56
+ a: {
57
+ b: 1
58
58
}
59
59
};
60
60
const obj4 = Object .create (obj1);
@@ -93,10 +93,10 @@ Second, object comparisons include a strict equality check of their prototypes.
93
93
``` js
94
94
const assert = require (' assert' );
95
95
96
- assert .deepEqual ({a : 1 }, {a : ' 1' });
96
+ assert .deepEqual ({ a : 1 }, { a : ' 1' });
97
97
// OK, because 1 == '1'
98
98
99
- assert .deepStrictEqual ({a : 1 }, {a : ' 1' });
99
+ assert .deepStrictEqual ({ a : 1 }, { a : ' 1' });
100
100
// AssertionError: { a: 1 } deepStrictEqual { a: '1' }
101
101
// because 1 !== '1' using strict equality
102
102
```
@@ -251,18 +251,18 @@ Tests for any deep inequality. Opposite of [`assert.deepEqual()`][].
251
251
const assert = require (' assert' );
252
252
253
253
const obj1 = {
254
- a : {
255
- b : 1
254
+ a: {
255
+ b: 1
256
256
}
257
257
};
258
258
const obj2 = {
259
- a : {
260
- b : 2
259
+ a: {
260
+ b: 2
261
261
}
262
262
};
263
263
const obj3 = {
264
- a : {
265
- b : 1
264
+ a: {
265
+ b: 1
266
266
}
267
267
};
268
268
const obj4 = Object .create (obj1);
@@ -297,10 +297,10 @@ Tests for deep strict inequality. Opposite of [`assert.deepStrictEqual()`][].
297
297
``` js
298
298
const assert = require (' assert' );
299
299
300
- assert .notDeepEqual ({a: 1 }, {a: ' 1' });
300
+ assert .notDeepEqual ({a: 1 }, {a: ' 1' });
301
301
// AssertionError: { a: 1 } notDeepEqual { a: '1' }
302
302
303
- assert .notDeepStrictEqual ({a: 1 }, {a: ' 1' });
303
+ assert .notDeepStrictEqual ({a: 1 }, {a: ' 1' });
304
304
// OK
305
305
```
306
306
@@ -466,7 +466,7 @@ assert.throws(
466
466
throw new Error (' Wrong value' );
467
467
},
468
468
function (err ) {
469
- if ( (err instanceof Error ) && / value/ .test (err) ) {
469
+ if ((err instanceof Error ) && / value/ .test (err)) {
470
470
return true ;
471
471
}
472
472
},
@@ -478,6 +478,7 @@ Note that `error` can not be a string. If a string is provided as the second
478
478
argument, then ` error ` is assumed to be omitted and the string will be used for
479
479
` message ` instead. This can lead to easy-to-miss mistakes:
480
480
481
+ <!-- eslint-disable assert-throws-arguments -->
481
482
``` js
482
483
// THIS IS A MISTAKE! DO NOT DO THIS!
483
484
assert .throws (myFunction, ' missing foo' , ' did not throw with expected message' );
0 commit comments