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 jest detects Error classes and can
decide to compare only message property, ignoring all others. Recommended to
not compare returned type agains 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 jest detects Error classes and can decide to compare only message property, ignoring all others. Recommended to not compare returned type agains an object of Error type.