Skip to content

Commit

Permalink
doc: add information about Assert behavior and maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Oct 16, 2015
1 parent 0f99320 commit 4075348
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions doc/api/assert.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

Stability: 2 - Stable

This module is used for writing assertion tests. You can access it with
`require('assert')`.
This module is used so that Node.js can test itself. You can access it with
`require('assert')`. However, it is recommended that you use a userland
assertion library instead.

## assert.fail(actual, expected, message, operator)

Expand All @@ -26,8 +27,16 @@ Tests shallow, coercive inequality with the not equal comparison operator

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

Tests for deep equality. Primitive values are compared with the equal comparison
operator ( `==` ). Doesn't take object prototypes into account.
Tests for deep equality. Primitive values are compared with the equal
comparison operator ( `==` ).

This only considers enumerable properties. It does not test object prototypes,
attached symbols, or non-enumerable properties. This can lead to some
potentially surprising results. For this does not throw an `AssertionError`
because the properties on the `Error` object are non-enumerable:

// WARNING: This probably does not do what you expect!
assert.deepEqual(Error('a'), Error('b'));

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

Expand Down

0 comments on commit 4075348

Please sign in to comment.