diff --git a/doc/api/assert.md b/doc/api/assert.md index 94272b4caaebf6..6a9d830158d3fa 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -958,7 +958,6 @@ function. See [`assert.throws()`][] for more details. Besides the async nature to await the completion behaves identically to [`assert.doesNotThrow()`][]. - ```mjs import assert from 'assert/strict'; @@ -983,7 +982,6 @@ const assert = require('assert/strict'); })(); ``` - ```mjs import assert from 'assert/strict'; @@ -993,7 +991,6 @@ assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) }); ``` - ```cjs const assert = require('assert/strict'); @@ -1042,7 +1039,6 @@ function. See [`assert.throws()`][] for more details. The following, for instance, will throw the [`TypeError`][] because there is no matching error type in the assertion: - ```mjs import assert from 'assert/strict'; @@ -1054,7 +1050,6 @@ assert.doesNotThrow( ); ``` - ```cjs const assert = require('assert/strict'); @@ -1069,7 +1064,6 @@ assert.doesNotThrow( However, the following will result in an [`AssertionError`][] with the message 'Got unwanted exception...': - ```mjs import assert from 'assert/strict'; @@ -1081,7 +1075,6 @@ assert.doesNotThrow( ); ``` - ```cjs const assert = require('assert/strict'); @@ -1097,7 +1090,6 @@ If an [`AssertionError`][] is thrown and a value is provided for the `message` parameter, the value of `message` will be appended to the [`AssertionError`][] message: - ```mjs import assert from 'assert/strict'; @@ -1111,7 +1103,6 @@ assert.doesNotThrow( // Throws: AssertionError: Got unwanted exception: Whoops ``` - ```cjs const assert = require('assert/strict'); @@ -2346,7 +2337,6 @@ message as the thrown error message is going to result in an `ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using a string as the second argument gets considered: - ```mjs import assert from 'assert/strict'; @@ -2383,7 +2373,6 @@ assert.throws(throwingFirst, /Second$/); // AssertionError [ERR_ASSERTION] ``` - ```cjs const assert = require('assert/strict');