Node.js assert() Function
The assert module provides a set of assertion functions for verifying invariants. In assert() function, if the value is not truth, then a AssertionError is thrown with a message property set equal to the value of the message parameter....
read more
Node.js Assert Complete Reference
Assert module in Node.js provides a bunch of facilities that are useful for the assertion of the function. The assert module provides a set of assertion functions for verifying invariants. If the condition is true it will output nothing else an assertion error is given by the console....
read more
Node.js assert.deepStrictEqual() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.deepStrictEqual() function tests for deep equality between the actual and expected parameters. If the condition is true it will not produce an output else an assertion error is raised....
read more
Node.js assert.equal() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.equal() function tests for equality between the actual and the expected parameters. If the condition is true it will not produce an output else an assertion error is raised....
read more
Node.js assert.match() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.match() function expects the string input to match the regular expression. If the condition is true it will not produce an output else an assertion error is raised....
read more
Node.js assert.doesNotThrow() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.doesNotThrow() function asserts that the function fn does not throw an error....
read more
Node.js assert.ifError() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.ifError() function throws value if value is not defined or null. When testing the error argument in callbacks, this function is very useful.Syntax:...
read more
Node.js assert.fail() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.fail() function throws an AssertionError with the provided the error message or with a default error message....
read more
Node.js assert.strictEqual() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.strictEqual() function tests strict equality between the actual and expected parameters. If the condition is true it will not produce an output else an assertion error is raised....
read more
Node.js assert.ok() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.ok() function tests if the value is true or not. If the condition is true it will not produce an output else an assertion error is raised....
read more
Node.js assert.rejects() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.rejects() function awaits the asyncFn promise or if the asyncFn is a function then it immediately calls the function and awaits the returned promise to complete and after that it will then check that the promise is rejected....
read more
Node.js assert.notDeepEqual() Function
The assert module provides a set of assertion functions for verifying invariants. The assert.notDeepEqual() function tests deep strict inequality between the actual and the expected parameters. If the condition is true it will not produce an output else an assertion error is raised.Syntax:...
read more