Skip to content

Commit

Permalink
doc: format doc/api/*.md with markdown formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Oct 11, 2021
1 parent 442ec1f commit 37c63bd
Show file tree
Hide file tree
Showing 58 changed files with 4,262 additions and 1,137 deletions.
1 change: 1 addition & 0 deletions doc/api/addons.md
Expand Up @@ -235,6 +235,7 @@ NODE_MODULE_INIT(/* exports, module, context */) {
```
#### Worker support
<!-- YAML
changes:
- version:
Expand Down
37 changes: 37 additions & 0 deletions doc/api/assert.md
Expand Up @@ -10,6 +10,7 @@ The `assert` module provides a set of assertion functions for verifying
invariants.

## Strict assertion mode

<!-- YAML
added: v9.9.0
changes:
Expand Down Expand Up @@ -138,6 +139,7 @@ Indicates the failure of an assertion. All errors thrown by the `assert` module
will be instances of the `AssertionError` class.

### `new assert.AssertionError(options)`

<!-- YAML
added: v0.1.21
-->
Expand Down Expand Up @@ -216,6 +218,7 @@ try {
```

## Class: `assert.CallTracker`

<!-- YAML
added:
- v14.2.0
Expand All @@ -227,6 +230,7 @@ added:
This feature is currently experimental and behavior might still change.

### `new assert.CallTracker()`

<!-- YAML
added:
- v14.2.0
Expand Down Expand Up @@ -278,6 +282,7 @@ process.on('exit', () => {
```

### `tracker.calls([fn][, exact])`

<!-- YAML
added:
- v14.2.0
Expand Down Expand Up @@ -320,6 +325,7 @@ const callsfunc = tracker.calls(func);
```

### `tracker.report()`

<!-- YAML
added:
- v14.2.0
Expand Down Expand Up @@ -396,6 +402,7 @@ tracker.report();
```

### `tracker.verify()`

<!-- YAML
added:
- v14.2.0
Expand Down Expand Up @@ -443,6 +450,7 @@ tracker.verify();
```

## `assert(value[, message])`

<!-- YAML
added: v0.5.9
-->
Expand All @@ -453,6 +461,7 @@ added: v0.5.9
An alias of [`assert.ok()`][].

## `assert.deepEqual(actual, expected[, message])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -629,6 +638,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the
[`AssertionError`][].

## `assert.deepStrictEqual(actual, expected[, message])`

<!-- YAML
added: v1.2.0
changes:
Expand Down Expand Up @@ -879,6 +889,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the
`AssertionError`.

## `assert.doesNotMatch(string, regexp[, message])`

<!-- YAML
added:
- v13.6.0
Expand Down Expand Up @@ -929,6 +940,7 @@ instance of an [`Error`][] then it will be thrown instead of the
[`AssertionError`][].

## `assert.doesNotReject(asyncFn[, error][, message])`

<!-- YAML
added: v10.0.0
-->
Expand Down Expand Up @@ -959,6 +971,7 @@ Besides the async nature to await the completion behaves identically to
[`assert.doesNotThrow()`][].

<!-- eslint-disable no-restricted-syntax -->

```mjs
import assert from 'assert/strict';

Expand All @@ -984,6 +997,7 @@ const assert = require('assert/strict');
```

<!-- eslint-disable no-restricted-syntax -->

```mjs
import assert from 'assert/strict';

Expand All @@ -994,6 +1008,7 @@ assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
```

<!-- eslint-disable no-restricted-syntax -->

```cjs
const assert = require('assert/strict');

Expand All @@ -1004,6 +1019,7 @@ assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
```

## `assert.doesNotThrow(fn[, error][, message])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -1043,6 +1059,7 @@ The following, for instance, will throw the [`TypeError`][] because there is no
matching error type in the assertion:

<!-- eslint-disable no-restricted-syntax -->

```mjs
import assert from 'assert/strict';

Expand All @@ -1055,6 +1072,7 @@ assert.doesNotThrow(
```

<!-- eslint-disable no-restricted-syntax -->

```cjs
const assert = require('assert/strict');

Expand All @@ -1070,6 +1088,7 @@ However, the following will result in an [`AssertionError`][] with the message
'Got unwanted exception...':

<!-- eslint-disable no-restricted-syntax -->

```mjs
import assert from 'assert/strict';

Expand All @@ -1082,6 +1101,7 @@ assert.doesNotThrow(
```

<!-- eslint-disable no-restricted-syntax -->

```cjs
const assert = require('assert/strict');

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

<!-- eslint-disable no-restricted-syntax -->

```mjs
import assert from 'assert/strict';

Expand All @@ -1112,6 +1133,7 @@ assert.doesNotThrow(
```

<!-- eslint-disable no-restricted-syntax -->

```cjs
const assert = require('assert/strict');

Expand All @@ -1126,6 +1148,7 @@ assert.doesNotThrow(
```

## `assert.equal(actual, expected[, message])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -1196,6 +1219,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the
`AssertionError`.

## `assert.fail([message])`

<!-- YAML
added: v0.1.21
-->
Expand Down Expand Up @@ -1236,6 +1260,7 @@ Using `assert.fail()` with more than two arguments is possible but deprecated.
See below for further details.

## `assert.fail(actual, expected[, message[, operator[, stackStartFn]]])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -1333,6 +1358,7 @@ suppressFrame();
```

## `assert.ifError(value)`

<!-- YAML
added: v0.1.97
changes:
Expand Down Expand Up @@ -1406,6 +1432,7 @@ let err;
```

## `assert.match(string, regexp[, message])`

<!-- YAML
added:
- v13.6.0
Expand Down Expand Up @@ -1456,6 +1483,7 @@ instance of an [`Error`][] then it will be thrown instead of the
[`AssertionError`][].

## `assert.notDeepEqual(actual, expected[, message])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -1579,6 +1607,7 @@ If the values are deeply equal, an [`AssertionError`][] is thrown with a
instead of the `AssertionError`.

## `assert.notDeepStrictEqual(actual, expected[, message])`

<!-- YAML
added: v1.2.0
changes:
Expand Down Expand Up @@ -1638,6 +1667,7 @@ the `message` parameter is an instance of an [`Error`][] then it will be thrown
instead of the [`AssertionError`][].

## `assert.notEqual(actual, expected[, message])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -1702,6 +1732,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the
`AssertionError`.

## `assert.notStrictEqual(actual, expected[, message])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -1754,6 +1785,7 @@ If the values are strictly equal, an [`AssertionError`][] is thrown with a
instead of the `AssertionError`.

## `assert.ok(value[, message])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -1871,6 +1903,7 @@ assert(0);
```

## `assert.rejects(asyncFn[, error][, message])`

<!-- YAML
added: v10.0.0
-->
Expand Down Expand Up @@ -1991,6 +2024,7 @@ example in [`assert.throws()`][] carefully if using a string as the second
argument gets considered.

## `assert.strictEqual(actual, expected[, message])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -2069,6 +2103,7 @@ If the values are not strictly equal, an [`AssertionError`][] is thrown with a
instead of the [`AssertionError`][].

## `assert.throws(fn[, error][, message])`

<!-- YAML
added: v0.1.21
changes:
Expand Down Expand Up @@ -2347,6 +2382,7 @@ message as the thrown error message is going to result in an
a string as the second argument gets considered:

<!-- eslint-disable no-restricted-syntax -->

```mjs
import assert from 'assert/strict';

Expand Down Expand Up @@ -2384,6 +2420,7 @@ assert.throws(throwingFirst, /Second$/);
```

<!-- eslint-disable no-restricted-syntax -->

```cjs
const assert = require('assert/strict');

Expand Down

0 comments on commit 37c63bd

Please sign in to comment.