File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 6
6
7
7
The ` assert ` module provides a set of assertion functions for verifying
8
8
invariants. The module provides a recommended [ ` strict ` mode] [ ] and a more
9
- lenient ` legacy ` mode.
9
+ lenient legacy mode.
10
10
11
11
For more information about the used equality comparisons see
12
12
[ MDN's guide on equality comparisons and sameness] [ mdn-equality-guide ] .
@@ -80,14 +80,14 @@ changes:
80
80
description: Added strict mode to the assert module.
81
81
-->
82
82
83
- When using the ` strict ` mode, any ` assert ` function will use the equality used
84
- in the strict function mode. So [ ` assert.deepEqual() ` ] [ ] will, for example,
85
- work the same as [ ` assert.deepStrictEqual() ` ] [ ] .
83
+ In ` strict ` mode, ` assert ` functions use the comparison in the corresponding
84
+ strict functions. For example, [ ` assert.deepEqual() ` ] [ ] will behave like
85
+ [ ` assert.deepStrictEqual() ` ] [ ] .
86
86
87
- On top of that , error messages which involve objects produce an error diff
88
- instead of displaying both objects. That is not the case for the legacy mode .
87
+ In ` strict ` mode , error messages for objects display a diff. In legacy mode,
88
+ error messages for objects display the objects, often truncated .
89
89
90
- It can be accessed using :
90
+ To use ` strict ` mode :
91
91
92
92
``` js
93
93
const assert = require (' assert' ).strict ;
You can’t perform that action at this time.
0 commit comments