|
5 | 5 | > Stability: 2 - Stable
|
6 | 6 |
|
7 | 7 | The `assert` module provides a simple set of assertion tests that can be used to
|
8 |
| -test invariants. |
9 |
| - |
10 |
| -A `strict` and a `legacy` mode exist, while it is recommended to only use |
11 |
| -[`strict mode`][]. |
| 8 | +test invariants. The module provides a recommended [`strict` mode][] and a more |
| 9 | +lenient `legacy` mode. |
12 | 10 |
|
13 | 11 | For more information about the used equality comparisons see
|
14 | 12 | [MDN's guide on equality comparisons and sameness][mdn-equality-guide].
|
@@ -89,7 +87,7 @@ changes:
|
89 | 87 | description: Added strict mode to the assert module.
|
90 | 88 | -->
|
91 | 89 |
|
92 |
| -When using the `strict mode`, any `assert` function will use the equality used |
| 90 | +When using the `strict` mode, any `assert` function will use the equality used |
93 | 91 | in the strict function mode. So [`assert.deepEqual()`][] will, for example,
|
94 | 92 | work the same as [`assert.deepStrictEqual()`][].
|
95 | 93 |
|
@@ -140,7 +138,7 @@ It can be accessed using:
|
140 | 138 | const assert = require('assert');
|
141 | 139 | ```
|
142 | 140 |
|
143 |
| -It is recommended to use the [`strict mode`][] instead as the |
| 141 | +It is recommended to use the [`strict` mode][] instead as the |
144 | 142 | [Abstract Equality Comparison][] can often have surprising results. This is
|
145 | 143 | especially true for [`assert.deepEqual()`][], where the comparison rules are
|
146 | 144 | lax:
|
@@ -1288,7 +1286,7 @@ second argument. This might lead to difficult-to-spot errors.
|
1288 | 1286 | [`assert.ok()`]: #assert_assert_ok_value_message
|
1289 | 1287 | [`assert.strictEqual()`]: #assert_assert_strictequal_actual_expected_message
|
1290 | 1288 | [`assert.throws()`]: #assert_assert_throws_fn_error_message
|
1291 |
| -[`strict mode`]: #assert_strict_mode |
| 1289 | +[`strict` mode]: #assert_strict_mode |
1292 | 1290 | [Abstract Equality Comparison]: https://tc39.github.io/ecma262/#sec-abstract-equality-comparison
|
1293 | 1291 | [Object wrappers]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript
|
1294 | 1292 | [Object.prototype.toString()]: https://tc39.github.io/ecma262/#sec-object.prototype.tostring
|
|
0 commit comments