Skip to content

Commit 37c63bd

Browse files
committed
doc: format doc/api/*.md with markdown formatter
1 parent 442ec1f commit 37c63bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4262
-1137
lines changed

doc/api/addons.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ NODE_MODULE_INIT(/* exports, module, context */) {
235235
```
236236
237237
#### Worker support
238+
238239
<!-- YAML
239240
changes:
240241
- version:

doc/api/assert.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The `assert` module provides a set of assertion functions for verifying
1010
invariants.
1111

1212
## Strict assertion mode
13+
1314
<!-- YAML
1415
added: v9.9.0
1516
changes:
@@ -138,6 +139,7 @@ Indicates the failure of an assertion. All errors thrown by the `assert` module
138139
will be instances of the `AssertionError` class.
139140

140141
### `new assert.AssertionError(options)`
142+
141143
<!-- YAML
142144
added: v0.1.21
143145
-->
@@ -216,6 +218,7 @@ try {
216218
```
217219

218220
## Class: `assert.CallTracker`
221+
219222
<!-- YAML
220223
added:
221224
- v14.2.0
@@ -227,6 +230,7 @@ added:
227230
This feature is currently experimental and behavior might still change.
228231

229232
### `new assert.CallTracker()`
233+
230234
<!-- YAML
231235
added:
232236
- v14.2.0
@@ -278,6 +282,7 @@ process.on('exit', () => {
278282
```
279283

280284
### `tracker.calls([fn][, exact])`
285+
281286
<!-- YAML
282287
added:
283288
- v14.2.0
@@ -320,6 +325,7 @@ const callsfunc = tracker.calls(func);
320325
```
321326

322327
### `tracker.report()`
328+
323329
<!-- YAML
324330
added:
325331
- v14.2.0
@@ -396,6 +402,7 @@ tracker.report();
396402
```
397403

398404
### `tracker.verify()`
405+
399406
<!-- YAML
400407
added:
401408
- v14.2.0
@@ -443,6 +450,7 @@ tracker.verify();
443450
```
444451

445452
## `assert(value[, message])`
453+
446454
<!-- YAML
447455
added: v0.5.9
448456
-->
@@ -453,6 +461,7 @@ added: v0.5.9
453461
An alias of [`assert.ok()`][].
454462

455463
## `assert.deepEqual(actual, expected[, message])`
464+
456465
<!-- YAML
457466
added: v0.1.21
458467
changes:
@@ -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
633643
added: v1.2.0
634644
changes:
@@ -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
883894
added:
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
933945
added: 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
963976
import 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
9881002
import 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
9981013
const 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
10081024
added: v0.1.21
10091025
changes:
@@ -1043,6 +1059,7 @@ The following, for instance, will throw the [`TypeError`][] because there is no
10431059
matching error type in the assertion:
10441060

10451061
<!-- eslint-disable no-restricted-syntax -->
1062+
10461063
```mjs
10471064
import assert from 'assert/strict';
10481065

@@ -1055,6 +1072,7 @@ assert.doesNotThrow(
10551072
```
10561073

10571074
<!-- eslint-disable no-restricted-syntax -->
1075+
10581076
```cjs
10591077
const 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
10741093
import assert from 'assert/strict';
10751094

@@ -1082,6 +1101,7 @@ assert.doesNotThrow(
10821101
```
10831102

10841103
<!-- eslint-disable no-restricted-syntax -->
1104+
10851105
```cjs
10861106
const assert = require('assert/strict');
10871107

@@ -1098,6 +1118,7 @@ parameter, the value of `message` will be appended to the [`AssertionError`][]
10981118
message:
10991119

11001120
<!-- eslint-disable no-restricted-syntax -->
1121+
11011122
```mjs
11021123
import assert from 'assert/strict';
11031124

@@ -1112,6 +1133,7 @@ assert.doesNotThrow(
11121133
```
11131134

11141135
<!-- eslint-disable no-restricted-syntax -->
1136+
11151137
```cjs
11161138
const assert = require('assert/strict');
11171139

@@ -1126,6 +1148,7 @@ assert.doesNotThrow(
11261148
```
11271149

11281150
## `assert.equal(actual, expected[, message])`
1151+
11291152
<!-- YAML
11301153
added: v0.1.21
11311154
changes:
@@ -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
12001224
added: v0.1.21
12011225
-->
@@ -1236,6 +1260,7 @@ Using `assert.fail()` with more than two arguments is possible but deprecated.
12361260
See below for further details.
12371261

12381262
## `assert.fail(actual, expected[, message[, operator[, stackStartFn]]])`
1263+
12391264
<!-- YAML
12401265
added: v0.1.21
12411266
changes:
@@ -1333,6 +1358,7 @@ suppressFrame();
13331358
```
13341359

13351360
## `assert.ifError(value)`
1361+
13361362
<!-- YAML
13371363
added: v0.1.97
13381364
changes:
@@ -1406,6 +1432,7 @@ let err;
14061432
```
14071433

14081434
## `assert.match(string, regexp[, message])`
1435+
14091436
<!-- YAML
14101437
added:
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
14601488
added: v0.1.21
14611489
changes:
@@ -1579,6 +1607,7 @@ If the values are deeply equal, an [`AssertionError`][] is thrown with a
15791607
instead of the `AssertionError`.
15801608

15811609
## `assert.notDeepStrictEqual(actual, expected[, message])`
1610+
15821611
<!-- YAML
15831612
added: v1.2.0
15841613
changes:
@@ -1638,6 +1667,7 @@ the `message` parameter is an instance of an [`Error`][] then it will be thrown
16381667
instead of the [`AssertionError`][].
16391668

16401669
## `assert.notEqual(actual, expected[, message])`
1670+
16411671
<!-- YAML
16421672
added: v0.1.21
16431673
changes:
@@ -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
17061737
added: v0.1.21
17071738
changes:
@@ -1754,6 +1785,7 @@ If the values are strictly equal, an [`AssertionError`][] is thrown with a
17541785
instead of the `AssertionError`.
17551786

17561787
## `assert.ok(value[, message])`
1788+
17571789
<!-- YAML
17581790
added: v0.1.21
17591791
changes:
@@ -1871,6 +1903,7 @@ assert(0);
18711903
```
18721904

18731905
## `assert.rejects(asyncFn[, error][, message])`
1906+
18741907
<!-- YAML
18751908
added: v10.0.0
18761909
-->
@@ -1991,6 +2024,7 @@ example in [`assert.throws()`][] carefully if using a string as the second
19912024
argument gets considered.
19922025

19932026
## `assert.strictEqual(actual, expected[, message])`
2027+
19942028
<!-- YAML
19952029
added: v0.1.21
19962030
changes:
@@ -2069,6 +2103,7 @@ If the values are not strictly equal, an [`AssertionError`][] is thrown with a
20692103
instead of the [`AssertionError`][].
20702104

20712105
## `assert.throws(fn[, error][, message])`
2106+
20722107
<!-- YAML
20732108
added: v0.1.21
20742109
changes:
@@ -2347,6 +2382,7 @@ message as the thrown error message is going to result in an
23472382
a string as the second argument gets considered:
23482383

23492384
<!-- eslint-disable no-restricted-syntax -->
2385+
23502386
```mjs
23512387
import assert from 'assert/strict';
23522388

@@ -2384,6 +2420,7 @@ assert.throws(throwingFirst, /Second$/);
23842420
```
23852421

23862422
<!-- eslint-disable no-restricted-syntax -->
2423+
23872424
```cjs
23882425
const assert = require('assert/strict');
23892426

0 commit comments

Comments
 (0)