Skip to main content

Module assert

Module assert 

Source
Expand description

Node assert module. Failing assertions throw an AssertionError (returned as an Err, which the host surfaces as a thrown JS exception).

Constants§

METHODS

Functions§

assert_ok
assert(value[, message]) — throws unless value is truthy.
call
construct_assertion_error
new assert.AssertionError(options) — a real Error-prototype-linked object carrying name/message/code/actual/expected/operator. Parent wires this to construct("AssertionError") and constant("assert","AssertionError").
deep_equal
Structural equality. strict compares leaves with ===, otherwise ==.
strict_call
The strict-mode variants (assert.strict.equal === assert.strictEqual). Maps the loose method names onto their strict counterparts, then delegates.