Skip to content

Commit

Permalink
doc: add changelogs for assert
Browse files Browse the repository at this point in the history
PR-URL: #11489
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
  • Loading branch information
addaleax committed Feb 24, 2017
1 parent d9d541d commit 42413b6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ assert(false, 'it\'s false');
## assert.deepEqual(actual, expected[, message])
<!-- YAML
added: v0.1.21
changes:
- version: v6.4.0, v4.7.1
pr-url: https://github.com/nodejs/node/pull/8002
description: Typed array slices are handled correctly now.
- version: v6.1.0, v4.5.0
pr-url: https://github.com/nodejs/node/pull/6432
description: Objects with circular references can be used as inputs now.
- version: v5.10.1, v4.4.3
pr-url: https://github.com/nodejs/node/pull/5910
description: Handle non-`Uint8Array` typed arrays correctly.
-->

Tests for deep equality between the `actual` and `expected` parameters.
Expand Down Expand Up @@ -91,6 +101,16 @@ parameter is undefined, a default error message is assigned.
## assert.deepStrictEqual(actual, expected[, message])
<!-- YAML
added: v1.2.0
changes:
- version: v6.4.0, v4.7.1
pr-url: https://github.com/nodejs/node/pull/8002
description: Typed array slices are handled correctly now.
- version: v6.1.0
pr-url: https://github.com/nodejs/node/pull/6432
description: Objects with circular references can be used as inputs now.
- version: v5.10.1, v4.4.3
pr-url: https://github.com/nodejs/node/pull/5910
description: Handle non-`Uint8Array` typed arrays correctly.
-->

Generally identical to `assert.deepEqual()` with two exceptions. First,
Expand All @@ -115,6 +135,13 @@ parameter is undefined, a default error message is assigned.
## assert.doesNotThrow(block[, error][, message])
<!-- YAML
added: v0.1.21
changes:
- version: v5.11.0, v4.4.5
pr-url: https://github.com/nodejs/node/pull/2407
description: The `message` parameter is respected now.
- version: v4.2.0
pr-url: https://github.com/nodejs/node/pull/3276
description: The `error` parameter can now be an arrow function.
-->

Asserts that the function `block` does not throw an error. See
Expand Down Expand Up @@ -402,6 +429,10 @@ If the values are not strictly equal, an `AssertionError` is thrown with a
## assert.throws(block[, error][, message])
<!-- YAML
added: v0.1.21
changes:
- version: v4.2.0
pr-url: https://github.com/nodejs/node/pull/3276
description: The `error` parameter can now be an arrow function.
-->

Expects the function `block` to throw an error.
Expand Down

0 comments on commit 42413b6

Please sign in to comment.