The Assert module provides simple assertion testing capabilities, primarily for internal use, and may be used externally after require (' assert '). The API for the assert module is locked state, which means that the API for this module will no longer be added or modified. assert Module Method list: assert (value[, message]) assert.deepequal (Actual, expected[, message]) Assert.deepstrictequal (Actual, expected[, message]) assert.doesnotthrow (block [, Error] [, message]) assert.equal (Actual, expected[, message]) assert.fail (actual, expected, message, operator) assert.iferror (value) assert.notdeepequal (Actual, expected[, message]) assert.notdeepstrictequal (Actual, expected[, message]) Assert.notequal (Actual, expected[, message])   assert.notstrictequal (Actual, expected[, message]) assert.ok (value[, Message]) assert.strictequal (Actual, expected[, message]) assert.throws (block[, error][, message])
ASSERT () is a shorthand for Assert.ok (), which is used in the same way. If value is true, nothing will happen. If value is False, an error is thrown that is a message.
- Assert.ok (value[, message])
The reference.
- Assert.equal (Actual, expected[, message])
Determines whether the actual value (actual) is equal to the expected 徝 (expected) (= =), and if not equal, throws a message error.
- Assert.notequal (Actual, expected[, message])
The reference.
- Assert.deepequal (Actual, expected[, message])
Deep means that the enumerable properties of the child objects are also computed. Passed if both the property and the child object properties are equal. Otherwise, an error is thrown.
- Assert.notdeepequal (Actual, expected[, message])
The reference.
- Assert.strictequal (Actual, expected[, message])
Usage, like assert.deepequal (), determines whether the condition is exactly equal (= = =).
- Assert.notstrictequal (Actual, expected[, message])
The reference.
- Assert.deepstrictequal (Actual, expected[, message])
Determine whether the condition is strictly equal to the depth.
- Assert.notdeepstrictequal (Actual, expected[, message])
The reference. These groups have the same API usage, only the conditions are different
- Assert.fail (actual, expected, message, operator)
Determines if the message is wrong (falsy), and if it is wrong (Falsy) throws an error message: The actual value operation operator expected. If the message is correct (truthy), then the message is thrown as a message error message.
Determines whether value is false, if false, and if ture, throws an error that the information is value.
- Assert.throws (block[, error][, message])
This is not very clear for the time being.
- Assert.doesnotthrow (block[, error][, message])
This is not very clear for the time being.
Nodejs Learning (a): Assert module