assert.strictEqual(actual, expected[, message])
Tests strict equality as determined by the strict equality operator ( ===
).
1 2 3 4 5 6 7 8 9 10 | const assert = require( 'assert' ); assert.strictEqual(1, 2); // AssertionError: 1 === 2 assert.strictEqual(1, 1); // OK assert.strictEqual(1, '1' ); // AssertionError: 1 === '1' |
If the values are not strictly equal, an AssertionError
is thrown with a message
property set equal to the value of the message
parameter. If the message
parameter is undefined, a default error message is assigned.
Please login to continue.