Package-level declarations
Types
Indicates the failure of an assertion. All errors thrown by the node:assert
module will be instances of the AssertionError
class.
This feature is deprecated and will be removed in a future version. Please consider using alternatives such as the mock
helper function.
Functions
Tests for deep equality between the actual
and expected
parameters. "Deep" equality means that the enumerable "own" properties of child objects are recursively evaluated also by the following rules.
Expects the string
input not to match the regular expression.
Awaits the asyncFn
promise or, if asyncFn
is a function, immediately calls the function and awaits the returned promise to complete. It will then check that the promise is not rejected.
Awaits the asyncFn
promise or, if asyncFn
is a function, immediately calls the function and awaits the returned promise to complete. It will then check that the promise is not rejected.
Asserts that the function fn
does not throw an error.
Tests strict equality between the actual
and expected
parameters as determined by Object.is()
.
Throws an AssertionError
with the provided error message or a default error message. If the message
parameter is an instance of an Error
then it will be thrown instead of the AssertionError
.
Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
Tests strict inequality between the actual
and expected
parameters as determined by Object.is()
.
Awaits the asyncFn
promise or, if asyncFn
is a function, immediately calls the function and awaits the returned promise to complete. It will then check that the promise is rejected.
Awaits the asyncFn
promise or, if asyncFn
is a function, immediately calls the function and awaits the returned promise to complete. It will then check that the promise is rejected.
Expects the function fn
to throw an error.