assert.fail(actual, expected, message, operator)
Throws an AssertionError
. If message
is falsy, the error message is set as the values of actual
and expected
separated by the provided operator
. Otherwise, the error message is the value of message
.
1 2 3 4 5 6 7 | const assert = require( 'assert' ); assert.fail(1, 2, undefined, '>' ); // AssertionError: 1 > 2 assert.fail(1, 2, 'whoops' , '>' ); // AssertionError: whoops |
Please login to continue.