diff options
author | Rich Trott <rtrott@gmail.com> | 2019-06-18 22:12:30 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-06-21 03:30:07 -0600 |
commit | 3af27f86b6d7a236ce0c1be55a22b17ee538b78f (patch) | |
tree | 4f7994a8d15d8c85b2d64c12da5cf48c6a7f6890 /doc/api/assert.md | |
parent | bfe4c9c2c014c909dd77d3981dfab8710336d9c0 (diff) | |
download | android-node-v8-3af27f86b6d7a236ce0c1be55a22b17ee538b78f.tar.gz android-node-v8-3af27f86b6d7a236ce0c1be55a22b17ee538b78f.tar.bz2 android-node-v8-3af27f86b6d7a236ce0c1be55a22b17ee538b78f.zip |
doc: revise strict mode text in assert
Revise the text describing `strict` mode.
PR-URL: https://github.com/nodejs/node/pull/28285
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'doc/api/assert.md')
-rw-r--r-- | doc/api/assert.md | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/api/assert.md b/doc/api/assert.md index c6e3302166..e611dfbe1b 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -6,7 +6,7 @@ The `assert` module provides a set of assertion functions for verifying invariants. The module provides a recommended [`strict` mode][] and a more -lenient `legacy` mode. +lenient legacy mode. For more information about the used equality comparisons see [MDN's guide on equality comparisons and sameness][mdn-equality-guide]. @@ -80,14 +80,14 @@ changes: description: Added strict mode to the assert module. --> -When using the `strict` mode, any `assert` function will use the equality used -in the strict function mode. So [`assert.deepEqual()`][] will, for example, -work the same as [`assert.deepStrictEqual()`][]. +In `strict` mode, `assert` functions use the comparison in the corresponding +strict functions. For example, [`assert.deepEqual()`][] will behave like +[`assert.deepStrictEqual()`][]. -On top of that, error messages which involve objects produce an error diff -instead of displaying both objects. That is not the case for the legacy mode. +In `strict` mode, error messages for objects display a diff. In legacy mode, +error messages for objects display the objects, often truncated. -It can be accessed using: +To use `strict` mode: ```js const assert = require('assert').strict; |