From af394c14f8173abe8f23bc33442efca6029d427b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 17 Sep 2015 23:17:15 -0700 Subject: [PATCH 1/3] doc: correct description of assert.ifError() This fixes a few typographical errors (comma splices and the like) and corrects the description of assert.ifError(). --- doc/api/assert.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/api/assert.markdown b/doc/api/assert.markdown index 59b7155bf99619..10f729f5b32e6d 100644 --- a/doc/api/assert.markdown +++ b/doc/api/assert.markdown @@ -2,7 +2,7 @@ Stability: 2 - Stable -This module is used for writing unit tests for your applications, you can +This module is used for writing unit tests for your applications. You can access it with `require('assert')`. ## assert.fail(actual, expected, message, operator) @@ -32,12 +32,12 @@ Tests for any deep inequality. Opposite of `assert.deepEqual`. ## assert.strictEqual(actual, expected[, message]) -Tests strict equality, as determined by the strict equality operator ( `===` ) +Tests strict equality as determined by the strict equality operator ( `===` ). ## assert.notStrictEqual(actual, expected[, message]) -Tests strict non-equality, as determined by the strict not equal -operator ( `!==` ) +Tests strict non-equality as determined by the strict not equal +operator ( `!==` ). ## assert.deepStrictEqual(actual, expected[, message]) @@ -50,7 +50,7 @@ Tests for deep inequality. Opposite of `assert.deepStrictEqual`. ## assert.throws(block[, error][, message]) -Expects `block` to throw an error. `error` can be constructor, `RegExp` or +Expects `block` to throw an error. `error` can be a constructor, `RegExp`, or validation function. Validate instanceof using constructor: @@ -87,9 +87,9 @@ Custom error validation: ## assert.doesNotThrow(block[, message]) -Expects `block` not to throw an error, see `assert.throws` for details. +Expects `block` not to throw an error. See `assert.throws()` for details. ## assert.ifError(value) -Tests if value is not a false value, throws if it is a true value. Useful when -testing the first argument, `error` in callbacks. +Tests if value is an `Error` and, if so, throws it. This is useful when +testing the `error` argument in callbacks. From 7c4a8f367ab1a567891b980745db80ac086e219c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 18 Sep 2015 00:02:43 -0700 Subject: [PATCH 2/3] fixup: refine ifError() text It throws if `value` is truthy. --- doc/api/assert.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/assert.markdown b/doc/api/assert.markdown index 10f729f5b32e6d..115619f3bb050b 100644 --- a/doc/api/assert.markdown +++ b/doc/api/assert.markdown @@ -91,5 +91,5 @@ Expects `block` not to throw an error. See `assert.throws()` for details. ## assert.ifError(value) -Tests if value is an `Error` and, if so, throws it. This is useful when -testing the `error` argument in callbacks. +Throws `value` if `value` is truthy. This is useful when testing the `error` +argument in callbacks. From 2f7dbc6f5407f87eb7064c0ec0e8b9488a7ca123 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 18 Sep 2015 08:54:00 -0700 Subject: [PATCH 3/3] fixup: non-equiality -> inequality --- doc/api/assert.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/assert.markdown b/doc/api/assert.markdown index 115619f3bb050b..4633b900a942ad 100644 --- a/doc/api/assert.markdown +++ b/doc/api/assert.markdown @@ -19,7 +19,8 @@ Tests shallow, coercive equality with the equal comparison operator ( `==` ). ## assert.notEqual(actual, expected[, message]) -Tests shallow, coercive non-equality with the not equal comparison operator ( `!=` ). +Tests shallow, coercive inequality with the not equal comparison operator +( `!=` ). ## assert.deepEqual(actual, expected[, message]) @@ -36,8 +37,8 @@ Tests strict equality as determined by the strict equality operator ( `===` ). ## assert.notStrictEqual(actual, expected[, message]) -Tests strict non-equality as determined by the strict not equal -operator ( `!==` ). +Tests strict inequality as determined by the strict not equal operator +( `!==` ). ## assert.deepStrictEqual(actual, expected[, message])