Skip to content

Commit 50977f7

Browse files
committed
doc: add added for assert.markdown
Introduces the YAML metadata concept and the "Added" property to the assert documentation.
1 parent fcae05e commit 50977f7

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

doc/api/assert.markdown

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Assert
2+
<!-- YAML
3+
added: v0.1.21
4+
-->
25

36
Stability: 3 - Locked
47

@@ -12,7 +15,14 @@ The API for the `assert` module is [Locked][]. This means that there will be no
1215
additions or changes to any of the methods implemented and exposed by
1316
the module.
1417

15-
## assert(value[, message]), assert.ok(value[, message])
18+
## assert(value[, message])
19+
<!-- YAML
20+
added: v0.5.9
21+
-->
22+
## assert.ok(value[, message])
23+
<!-- YAML
24+
added: v0.1.21
25+
-->
1626

1727
Tests if `value` is truthy. It is equivalent to
1828
`assert.equal(!!value, true, message)`.
@@ -44,6 +54,9 @@ assert.ok(false, 'it\'s false');
4454
```
4555

4656
## assert.deepEqual(actual, expected[, message])
57+
<!-- YAML
58+
added: v0.1.21
59+
-->
4760

4861
Tests for deep equality between the `actual` and `expected` parameters.
4962
Primitive values are compared with the equal comparison operator ( `==` ).
@@ -102,6 +115,9 @@ property set equal to the value of the `message` parameter. If the `message`
102115
parameter is undefined, a default error message is assigned.
103116

104117
## assert.deepStrictEqual(actual, expected[, message])
118+
<!-- YAML
119+
added: v1.2.0
120+
-->
105121

106122
Generally identical to `assert.deepEqual` with the exception that primitive
107123
values are compared using the strict equality operator ( `===` ).
@@ -122,6 +138,9 @@ property set equal to the value of the `message` parameter. If the `message`
122138
parameter is undefined, a default error message is assigned.
123139

124140
## assert.doesNotThrow(block[, error][, message])
141+
<!-- YAML
142+
added: v0.1.21
143+
-->
125144

126145
Asserts that the function `block` does not throw an error. See
127146
[`assert.throws()`][] for more details.
@@ -174,6 +193,9 @@ assert.doesNotThrow(
174193
```
175194

176195
## assert.equal(actual, expected[, message])
196+
<!-- YAML
197+
added: v0.1.21
198+
-->
177199

178200
Tests shallow, coercive equality between the `actual` and `expected` parameters
179201
using the equal comparison operator ( `==` ).
@@ -197,6 +219,9 @@ property set equal to the value of the `message` parameter. If the `message`
197219
parameter is undefined, a default error message is assigned.
198220

199221
## assert.fail(actual, expected, message, operator)
222+
<!-- YAML
223+
added: v0.1.21
224+
-->
200225

201226
Throws an `AssertionError`. If `message` is falsy, the error message is set as
202227
the values of `actual` and `expected` separated by the provided `operator`.
@@ -213,6 +238,9 @@ assert.fail(1, 2, 'whoops', '>');
213238
```
214239

215240
## assert.ifError(value)
241+
<!-- YAML
242+
added: v0.1.97
243+
-->
216244

217245
Throws `value` if `value` is truthy. This is useful when testing the `error`
218246
argument in callbacks.
@@ -227,6 +255,9 @@ assert.ifError(new Error()); // Throws Error
227255
```
228256

229257
## assert.notDeepEqual(actual, expected[, message])
258+
<!-- YAML
259+
added: v0.1.21
260+
-->
230261

231262
Tests for any deep inequality. Opposite of [`assert.deepEqual`][].
232263

@@ -268,6 +299,9 @@ property set equal to the value of the `message` parameter. If the `message`
268299
parameter is undefined, a default error message is assigned.
269300

270301
## assert.notDeepStrictEqual(actual, expected[, message])
302+
<!-- YAML
303+
added: v1.2.0
304+
-->
271305

272306
Tests for deep strict inequality. Opposite of [`assert.deepStrictEqual`][].
273307

@@ -286,6 +320,9 @@ with a `message` property set equal to the value of the `message` parameter. If
286320
the `message` parameter is undefined, a default error message is assigned.
287321

288322
## assert.notEqual(actual, expected[, message])
323+
<!-- YAML
324+
added: v0.1.21
325+
-->
289326

290327
Tests shallow, coercive inequality with the not equal comparison operator
291328
( `!=` ).
@@ -308,6 +345,9 @@ property set equal to the value of the `message` parameter. If the `message`
308345
parameter is undefined, a default error message is assigned.
309346

310347
## assert.notStrictEqual(actual, expected[, message])
348+
<!-- YAML
349+
added: v0.1.21
350+
-->
311351

312352
Tests strict inequality as determined by the strict not equal operator
313353
( `!==` ).
@@ -330,6 +370,9 @@ If the values are strictly equal, an `AssertionError` is thrown with a
330370
`message` parameter is undefined, a default error message is assigned.
331371

332372
## assert.strictEqual(actual, expected[, message])
373+
<!-- YAML
374+
added: v0.1.21
375+
-->
333376

334377
Tests strict equality as determined by the strict equality operator ( `===` ).
335378

@@ -351,6 +394,9 @@ If the values are not strictly equal, an `AssertionError` is thrown with a
351394
`message` parameter is undefined, a default error message is assigned.
352395

353396
## assert.throws(block[, error][, message])
397+
<!-- YAML
398+
added: v0.1.21
399+
-->
354400

355401
Expects the function `block` to throw an error. If specified, `error` can be a
356402
constructor, [`RegExp`][], or validation function.

0 commit comments

Comments
 (0)