@@ -10,6 +10,7 @@ The `assert` module provides a set of assertion functions for verifying
1010invariants.
1111
1212## Strict assertion mode
13+
1314<!-- YAML
1415added: v9.9.0
1516changes:
@@ -138,6 +139,7 @@ Indicates the failure of an assertion. All errors thrown by the `assert` module
138139will be instances of the ` AssertionError ` class.
139140
140141### ` new assert.AssertionError(options) `
142+
141143<!-- YAML
142144added: v0.1.21
143145-->
@@ -216,6 +218,7 @@ try {
216218```
217219
218220## Class: ` assert.CallTracker `
221+
219222<!-- YAML
220223added:
221224 - v14.2.0
@@ -227,6 +230,7 @@ added:
227230This feature is currently experimental and behavior might still change.
228231
229232### ` new assert.CallTracker() `
233+
230234<!-- YAML
231235added:
232236 - v14.2.0
@@ -278,6 +282,7 @@ process.on('exit', () => {
278282```
279283
280284### ` tracker.calls([fn][, exact]) `
285+
281286<!-- YAML
282287added:
283288 - v14.2.0
@@ -320,6 +325,7 @@ const callsfunc = tracker.calls(func);
320325```
321326
322327### ` tracker.report() `
328+
323329<!-- YAML
324330added:
325331 - v14.2.0
@@ -396,6 +402,7 @@ tracker.report();
396402```
397403
398404### ` tracker.verify() `
405+
399406<!-- YAML
400407added:
401408 - v14.2.0
@@ -443,6 +450,7 @@ tracker.verify();
443450```
444451
445452## ` assert(value[, message]) `
453+
446454<!-- YAML
447455added: v0.5.9
448456-->
@@ -453,6 +461,7 @@ added: v0.5.9
453461An alias of [ ` assert.ok() ` ] [ ] .
454462
455463## ` assert.deepEqual(actual, expected[, message]) `
464+
456465<!-- YAML
457466added: v0.1.21
458467changes:
@@ -629,6 +638,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the
629638[ ` AssertionError ` ] [ ] .
630639
631640## ` assert.deepStrictEqual(actual, expected[, message]) `
641+
632642<!-- YAML
633643added: v1.2.0
634644changes:
@@ -879,6 +889,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the
879889` AssertionError ` .
880890
881891## ` assert.doesNotMatch(string, regexp[, message]) `
892+
882893<!-- YAML
883894added:
884895 - v13.6.0
@@ -929,6 +940,7 @@ instance of an [`Error`][] then it will be thrown instead of the
929940[ ` AssertionError ` ] [ ] .
930941
931942## ` assert.doesNotReject(asyncFn[, error][, message]) `
943+
932944<!-- YAML
933945added: v10.0.0
934946-->
@@ -959,6 +971,7 @@ Besides the async nature to await the completion behaves identically to
959971[ ` assert.doesNotThrow() ` ] [ ] .
960972
961973<!-- eslint-disable no-restricted-syntax -->
974+
962975``` mjs
963976import assert from ' assert/strict' ;
964977
@@ -984,6 +997,7 @@ const assert = require('assert/strict');
984997```
985998
986999<!-- eslint-disable no-restricted-syntax -->
1000+
9871001``` mjs
9881002import assert from ' assert/strict' ;
9891003
@@ -994,6 +1008,7 @@ assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
9941008```
9951009
9961010<!-- eslint-disable no-restricted-syntax -->
1011+
9971012``` cjs
9981013const assert = require (' assert/strict' );
9991014
@@ -1004,6 +1019,7 @@ assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
10041019```
10051020
10061021## ` assert.doesNotThrow(fn[, error][, message]) `
1022+
10071023<!-- YAML
10081024added: v0.1.21
10091025changes:
@@ -1043,6 +1059,7 @@ The following, for instance, will throw the [`TypeError`][] because there is no
10431059matching error type in the assertion:
10441060
10451061<!-- eslint-disable no-restricted-syntax -->
1062+
10461063``` mjs
10471064import assert from ' assert/strict' ;
10481065
@@ -1055,6 +1072,7 @@ assert.doesNotThrow(
10551072```
10561073
10571074<!-- eslint-disable no-restricted-syntax -->
1075+
10581076``` cjs
10591077const assert = require (' assert/strict' );
10601078
@@ -1070,6 +1088,7 @@ However, the following will result in an [`AssertionError`][] with the message
10701088'Got unwanted exception...':
10711089
10721090<!-- eslint-disable no-restricted-syntax -->
1091+
10731092``` mjs
10741093import assert from ' assert/strict' ;
10751094
@@ -1082,6 +1101,7 @@ assert.doesNotThrow(
10821101```
10831102
10841103<!-- eslint-disable no-restricted-syntax -->
1104+
10851105``` cjs
10861106const assert = require (' assert/strict' );
10871107
@@ -1098,6 +1118,7 @@ parameter, the value of `message` will be appended to the [`AssertionError`][]
10981118message:
10991119
11001120<!-- eslint-disable no-restricted-syntax -->
1121+
11011122``` mjs
11021123import assert from ' assert/strict' ;
11031124
@@ -1112,6 +1133,7 @@ assert.doesNotThrow(
11121133```
11131134
11141135<!-- eslint-disable no-restricted-syntax -->
1136+
11151137``` cjs
11161138const assert = require (' assert/strict' );
11171139
@@ -1126,6 +1148,7 @@ assert.doesNotThrow(
11261148```
11271149
11281150## ` assert.equal(actual, expected[, message]) `
1151+
11291152<!-- YAML
11301153added: v0.1.21
11311154changes:
@@ -1196,6 +1219,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the
11961219` AssertionError ` .
11971220
11981221## ` assert.fail([message]) `
1222+
11991223<!-- YAML
12001224added: v0.1.21
12011225-->
@@ -1236,6 +1260,7 @@ Using `assert.fail()` with more than two arguments is possible but deprecated.
12361260See below for further details.
12371261
12381262## ` assert.fail(actual, expected[, message[, operator[, stackStartFn]]]) `
1263+
12391264<!-- YAML
12401265added: v0.1.21
12411266changes:
@@ -1333,6 +1358,7 @@ suppressFrame();
13331358```
13341359
13351360## ` assert.ifError(value) `
1361+
13361362<!-- YAML
13371363added: v0.1.97
13381364changes:
@@ -1406,6 +1432,7 @@ let err;
14061432```
14071433
14081434## ` assert.match(string, regexp[, message]) `
1435+
14091436<!-- YAML
14101437added:
14111438 - v13.6.0
@@ -1456,6 +1483,7 @@ instance of an [`Error`][] then it will be thrown instead of the
14561483[ ` AssertionError ` ] [ ] .
14571484
14581485## ` assert.notDeepEqual(actual, expected[, message]) `
1486+
14591487<!-- YAML
14601488added: v0.1.21
14611489changes:
@@ -1579,6 +1607,7 @@ If the values are deeply equal, an [`AssertionError`][] is thrown with a
15791607instead of the ` AssertionError ` .
15801608
15811609## ` assert.notDeepStrictEqual(actual, expected[, message]) `
1610+
15821611<!-- YAML
15831612added: v1.2.0
15841613changes:
@@ -1638,6 +1667,7 @@ the `message` parameter is an instance of an [`Error`][] then it will be thrown
16381667instead of the [ ` AssertionError ` ] [ ] .
16391668
16401669## ` assert.notEqual(actual, expected[, message]) `
1670+
16411671<!-- YAML
16421672added: v0.1.21
16431673changes:
@@ -1702,6 +1732,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the
17021732` AssertionError ` .
17031733
17041734## ` assert.notStrictEqual(actual, expected[, message]) `
1735+
17051736<!-- YAML
17061737added: v0.1.21
17071738changes:
@@ -1754,6 +1785,7 @@ If the values are strictly equal, an [`AssertionError`][] is thrown with a
17541785instead of the ` AssertionError ` .
17551786
17561787## ` assert.ok(value[, message]) `
1788+
17571789<!-- YAML
17581790added: v0.1.21
17591791changes:
@@ -1871,6 +1903,7 @@ assert(0);
18711903```
18721904
18731905## ` assert.rejects(asyncFn[, error][, message]) `
1906+
18741907<!-- YAML
18751908added: v10.0.0
18761909-->
@@ -1991,6 +2024,7 @@ example in [`assert.throws()`][] carefully if using a string as the second
19912024argument gets considered.
19922025
19932026## ` assert.strictEqual(actual, expected[, message]) `
2027+
19942028<!-- YAML
19952029added: v0.1.21
19962030changes:
@@ -2069,6 +2103,7 @@ If the values are not strictly equal, an [`AssertionError`][] is thrown with a
20692103instead of the [ ` AssertionError ` ] [ ] .
20702104
20712105## ` assert.throws(fn[, error][, message]) `
2106+
20722107<!-- YAML
20732108added: v0.1.21
20742109changes:
@@ -2347,6 +2382,7 @@ message as the thrown error message is going to result in an
23472382a string as the second argument gets considered:
23482383
23492384<!-- eslint-disable no-restricted-syntax -->
2385+
23502386``` mjs
23512387import assert from ' assert/strict' ;
23522388
@@ -2384,6 +2420,7 @@ assert.throws(throwingFirst, /Second$/);
23842420```
23852421
23862422<!-- eslint-disable no-restricted-syntax -->
2423+
23872424``` cjs
23882425const assert = require (' assert/strict' );
23892426
0 commit comments