2
"source": "doc/api/assert.markdown",
8
"stabilityText": "Locked",
9
"desc": "<p>This module is used for writing unit tests for your applications, you can\naccess it with <code>require('assert')</code>.\n\n</p>\n",
12
"textRaw": "assert.fail(actual, expected, message, operator)",
15
"desc": "<p>Throws an exception that displays the values for <code>actual</code> and <code>expected</code> separated by the provided operator.\n\n</p>\n",
36
"textRaw": "assert(value, message), assert.ok(value, [message])",
39
"desc": "<p>Tests if value is truthy, it is equivalent to <code>assert.equal(true, !!value, message);</code>\n\n</p>\n",
50
"name": "assert.ok(value"
61
"textRaw": "assert.equal(actual, expected, [message])",
64
"desc": "<p>Tests shallow, coercive equality with the equal comparison operator ( <code>==</code> ).\n\n</p>\n",
83
"textRaw": "assert.notEqual(actual, expected, [message])",
86
"desc": "<p>Tests shallow, coercive non-equality with the not equal comparison operator ( <code>!=</code> ).\n\n</p>\n",
105
"textRaw": "assert.deepEqual(actual, expected, [message])",
108
"desc": "<p>Tests for deep equality.\n\n</p>\n",
127
"textRaw": "assert.notDeepEqual(actual, expected, [message])",
129
"name": "notDeepEqual",
130
"desc": "<p>Tests for any deep inequality.\n\n</p>\n",
149
"textRaw": "assert.strictEqual(actual, expected, [message])",
151
"name": "strictEqual",
152
"desc": "<p>Tests strict equality, as determined by the strict equality operator ( <code>===</code> )\n\n</p>\n",
171
"textRaw": "assert.notStrictEqual(actual, expected, [message])",
173
"name": "notStrictEqual",
174
"desc": "<p>Tests strict non-equality, as determined by the strict not equal operator ( <code>!==</code> )\n\n</p>\n",
193
"textRaw": "assert.throws(block, [error], [message])",
196
"desc": "<p>Expects <code>block</code> to throw an error. <code>error</code> can be constructor, regexp or \nvalidation function.\n\n</p>\n<p>Validate instanceof using constructor:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error("Wrong value");\n },\n Error\n);</code></pre>\n<p>Validate error message using RegExp:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error("Wrong value");\n },\n /value/\n);</code></pre>\n<p>Custom error validation:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error("Wrong value");\n },\n function(err) {\n if ( (err instanceof Error) && /value/.test(err) ) {\n return true;\n }\n },\n "unexpected error"\n);</code></pre>\n",
216
"textRaw": "assert.doesNotThrow(block, [message])",
218
"name": "doesNotThrow",
219
"desc": "<p>Expects <code>block</code> not to throw an error, see assert.throws for details.\n\n</p>\n",
235
"textRaw": "assert.ifError(value)",
238
"desc": "<p>Tests if value is not a false value, throws if it is a true value. Useful when\ntesting the first argument, <code>error</code> in callbacks.\n</p>\n",
251
"displayName": "Assert"