diff --git a/doc/api/assert.md b/doc/api/assert.md index 591d26a515dc71..9ce918dab9480c 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -326,7 +326,7 @@ rejected. See [`assert.rejects()`][] for more details. When `assert.doesNotReject()` is called, it will immediately call the `block` function, and awaits for completion. -Besides the async nature to await the completion behaves identical to +Besides the async nature to await the completion behaves identically to [`assert.doesNotThrow()`][]. ```js @@ -844,40 +844,6 @@ assert(0); // assert(0) ``` -## assert.strictEqual(actual, expected[, message]) - -* `actual` {any} -* `expected` {any} -* `message` {any} - -Tests strict equality between the `actual` and `expected` parameters as -determined by the [SameValue Comparison][]. - -```js -const assert = require('assert').strict; - -assert.strictEqual(1, 2); -// AssertionError: 1 strictEqual 2 - -assert.strictEqual(1, 1); -// OK - -assert.strictEqual(1, '1'); -// AssertionError: 1 strictEqual '1' -``` - -If the values are not strictly equal, an `AssertionError` is thrown with a -`message` property set equal to the value of the `message` parameter. If the -`message` parameter is undefined, a default error message is assigned. If the -`message` parameter is an instance of an [`Error`][] then it will be thrown -instead of the `AssertionError`. - ## assert.rejects(block[, error][, message]) +* `actual` {any} +* `expected` {any} +* `message` {any} + +Tests strict equality between the `actual` and `expected` parameters as +determined by the [SameValue Comparison][]. + +```js +const assert = require('assert').strict; + +assert.strictEqual(1, 2); +// AssertionError: 1 strictEqual 2 + +assert.strictEqual(1, 1); +// OK + +assert.strictEqual(1, '1'); +// AssertionError: 1 strictEqual '1' +``` + +If the values are not strictly equal, an `AssertionError` is thrown with a +`message` property set equal to the value of the `message` parameter. If the +`message` parameter is undefined, a default error message is assigned. If the +`message` parameter is an instance of an [`Error`][] then it will be thrown +instead of the `AssertionError`. + ## assert.throws(block[, error][, message])