Test function. Checks that a synchronous function throws an error on
execution. It returns a serialized thrown error. Allows easier inspection of
the thrown error.
The returned object is serialized because test runners can detect Error
classes and decide to compare only message property, ignoring all others.
Recommended to not compare returned type against an object of Error type.
Test function. Checks that a synchronous function throws an error on execution. It returns a serialized thrown error. Allows easier inspection of the thrown error.
The returned object is serialized because test runners can detect Error classes and decide to compare only message property, ignoring all others. Recommended to not compare returned type against an object of Error type.