From b11e0020181631844fefa56a2b0574afcbbd8e16 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 7 Dec 2015 19:03:21 -0800 Subject: [PATCH] doc: clarify assert.fail doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/4186 Reviewed-By: Michaƫl Zasso Reviewed-By: Roman Klauke Reviewed-By: Minwoo Jung --- doc/api/assert.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/assert.markdown b/doc/api/assert.markdown index c35fc1ad0832a0..a3fb229161b31e 100644 --- a/doc/api/assert.markdown +++ b/doc/api/assert.markdown @@ -62,8 +62,9 @@ Tests shallow, coercive equality with the equal comparison operator ( `==` ). ## assert.fail(actual, expected, message, operator) -Throws an exception that displays the values for `actual` and `expected` -separated by the provided operator. +Throws an `AssertionError`. If `message` is falsy, it displays the values for +`actual` and `expected` separated by the provided `operator`. Otherwise, it +displays `message` (and does not use `actual`, `expected`, and `operator`). ## assert.ifError(value)