Skip to content

Commit 128f812

Browse files
ameliavoncatitaloacasas
authored andcommitted
doc: argument types for assert methods
Refs: #9399 PR-URL: #11548 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 4b05ec3 commit 128f812

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

doc/api/assert.md

+39
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ test invariants.
99
<!-- YAML
1010
added: v0.5.9
1111
-->
12+
* `value` {any}
13+
* `message` {any}
1214

1315
An alias of [`assert.ok()`][] .
1416

@@ -41,6 +43,9 @@ changes:
4143
pr-url: https://github.com/nodejs/node/pull/5910
4244
description: Handle non-`Uint8Array` typed arrays correctly.
4345
-->
46+
* `actual` {any}
47+
* `expected` {any}
48+
* `message` {any}
4449

4550
Tests for deep equality between the `actual` and `expected` parameters.
4651
Primitive values are compared with the equal comparison operator ( `==` ).
@@ -112,6 +117,9 @@ changes:
112117
pr-url: https://github.com/nodejs/node/pull/5910
113118
description: Handle non-`Uint8Array` typed arrays correctly.
114119
-->
120+
* `actual` {any}
121+
* `expected` {any}
122+
* `message` {any}
115123

116124
Generally identical to `assert.deepEqual()` with two exceptions. First,
117125
primitive values are compared using the strict equality operator ( `===` ).
@@ -143,6 +151,9 @@ changes:
143151
pr-url: https://github.com/nodejs/node/pull/3276
144152
description: The `error` parameter can now be an arrow function.
145153
-->
154+
* `block` {Function}
155+
* `error` {RegExp|Function}
156+
* `message` {any}
146157

147158
Asserts that the function `block` does not throw an error. See
148159
[`assert.throws()`][] for more details.
@@ -198,6 +209,9 @@ assert.doesNotThrow(
198209
<!-- YAML
199210
added: v0.1.21
200211
-->
212+
* `actual` {any}
213+
* `expected` {any}
214+
* `message` {any}
201215

202216
Tests shallow, coercive equality between the `actual` and `expected` parameters
203217
using the equal comparison operator ( `==` ).
@@ -224,6 +238,10 @@ parameter is undefined, a default error message is assigned.
224238
<!-- YAML
225239
added: v0.1.21
226240
-->
241+
* `actual` {any}
242+
* `expected` {any}
243+
* `message` {any}
244+
* `operator` {String}
227245

228246
Throws an `AssertionError`. If `message` is falsy, the error message is set as
229247
the values of `actual` and `expected` separated by the provided `operator`.
@@ -243,6 +261,7 @@ assert.fail(1, 2, 'whoops', '>');
243261
<!-- YAML
244262
added: v0.1.97
245263
-->
264+
* `value` {any}
246265

247266
Throws `value` if `value` is truthy. This is useful when testing the `error`
248267
argument in callbacks.
@@ -264,6 +283,9 @@ assert.ifError(new Error());
264283
<!-- YAML
265284
added: v0.1.21
266285
-->
286+
* `actual` {any}
287+
* `expected` {any}
288+
* `message` {any}
267289

268290
Tests for any deep inequality. Opposite of [`assert.deepEqual()`][].
269291

@@ -308,6 +330,9 @@ parameter is undefined, a default error message is assigned.
308330
<!-- YAML
309331
added: v1.2.0
310332
-->
333+
* `actual` {any}
334+
* `expected` {any}
335+
* `message` {any}
311336

312337
Tests for deep strict inequality. Opposite of [`assert.deepStrictEqual()`][].
313338

@@ -329,6 +354,9 @@ the `message` parameter is undefined, a default error message is assigned.
329354
<!-- YAML
330355
added: v0.1.21
331356
-->
357+
* `actual` {any}
358+
* `expected` {any}
359+
* `message` {any}
332360

333361
Tests shallow, coercive inequality with the not equal comparison operator
334362
( `!=` ).
@@ -354,6 +382,9 @@ parameter is undefined, a default error message is assigned.
354382
<!-- YAML
355383
added: v0.1.21
356384
-->
385+
* `actual` {any}
386+
* `expected` {any}
387+
* `message` {any}
357388

358389
Tests strict inequality as determined by the strict not equal operator
359390
( `!==` ).
@@ -379,6 +410,8 @@ If the values are strictly equal, an `AssertionError` is thrown with a
379410
<!-- YAML
380411
added: v0.1.21
381412
-->
413+
* `value` {any}
414+
* `message` {any}
382415

383416
Tests if `value` is truthy. It is equivalent to
384417
`assert.equal(!!value, true, message)`.
@@ -406,6 +439,9 @@ assert.ok(false, 'it\'s false');
406439
<!-- YAML
407440
added: v0.1.21
408441
-->
442+
* `actual` {any}
443+
* `expected` {any}
444+
* `message` {any}
409445

410446
Tests strict equality as determined by the strict equality operator ( `===` ).
411447

@@ -434,6 +470,9 @@ changes:
434470
pr-url: https://github.com/nodejs/node/pull/3276
435471
description: The `error` parameter can now be an arrow function.
436472
-->
473+
* `block` {Function}
474+
* `error` {RegExp|Function}
475+
* `message` {any}
437476

438477
Expects the function `block` to throw an error.
439478

0 commit comments

Comments
 (0)