-
-
Notifications
You must be signed in to change notification settings - Fork 226
Open
Description
Hey,
I would expect toThrowWithMessage to help with asserting extra/extended Error types. Consider extra fields besides just the error class type and message.
I have this type:
class ExecutionError extends Error {
exitCode: number;
failedCommand: string;
constructor(errorMessage: string, exitCode: number, failedCommand: string) {
super(errorMessage);
this.exitCode = exitCode;
this.failedCommand = failedCommand;
}
}
which I wish I could assert failedCommand easily in a test.
I tried toStrictEqual too, without luck.
WDYT? Can you add such a thing?
Thanks!
weinguy-env0, onhate and felix-wooliesx
Metadata
Metadata
Assignees
Labels
No labels