Skip to content

Commit f7edbab

Browse files
TrottFishrock123
authored andcommitted
doc: clarify description of assert.ifError()
This fixes a few typographical errors (comma splices and the like) and clarifies the description of assert.ifError(). It also standardizes the document on "inequality" rather than having both "inequality" and "non- equality". PR-URL: #2941 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent f542e74 commit f7edbab

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

doc/api/assert.markdown

+10-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Stability: 2 - Stable
44

5-
This module is used for writing unit tests for your applications, you can
5+
This module is used for writing unit tests for your applications. You can
66
access it with `require('assert')`.
77

88
## assert.fail(actual, expected, message, operator)
@@ -19,7 +19,8 @@ Tests shallow, coercive equality with the equal comparison operator ( `==` ).
1919

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

22-
Tests shallow, coercive non-equality with the not equal comparison operator ( `!=` ).
22+
Tests shallow, coercive inequality with the not equal comparison operator
23+
( `!=` ).
2324

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

@@ -32,12 +33,12 @@ Tests for any deep inequality. Opposite of `assert.deepEqual`.
3233

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

35-
Tests strict equality, as determined by the strict equality operator ( `===` )
36+
Tests strict equality as determined by the strict equality operator ( `===` ).
3637

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

39-
Tests strict non-equality, as determined by the strict not equal
40-
operator ( `!==` )
40+
Tests strict inequality as determined by the strict not equal operator
41+
( `!==` ).
4142

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

@@ -50,7 +51,7 @@ Tests for deep inequality. Opposite of `assert.deepStrictEqual`.
5051

5152
## assert.throws(block[, error][, message])
5253

53-
Expects `block` to throw an error. `error` can be constructor, `RegExp` or
54+
Expects `block` to throw an error. `error` can be a constructor, `RegExp`, or
5455
validation function.
5556

5657
Validate instanceof using constructor:
@@ -87,9 +88,9 @@ Custom error validation:
8788

8889
## assert.doesNotThrow(block[, message])
8990

90-
Expects `block` not to throw an error, see `assert.throws` for details.
91+
Expects `block` not to throw an error. See `assert.throws()` for details.
9192

9293
## assert.ifError(value)
9394

94-
Tests if value is not a false value, throws if it is a true value. Useful when
95-
testing the first argument, `error` in callbacks.
95+
Throws `value` if `value` is truthy. This is useful when testing the `error`
96+
argument in callbacks.

0 commit comments

Comments
 (0)