You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export JestAssertionError from expect to allow other packages to import it. This is a clone of #9919 as it's still relevant I think?
Motivation
Given that the expect package is modular and published as a standalone package on npm, I'm using it outside of jest and outside of tests. I'm currently trying to use it for implementing a custom mock server for a dev environment. To properly implement this, I need to distinguish expect exceptions from other exceptions, and thus need to do
if (err instanceof JestAssertionError) {}
However this is not currently possible seen as I can't import JestAssertionError from expect
🚀 Feature Proposal
export JestAssertionError from expect to allow other packages to import it. This is a clone of #9919 as it's still relevant I think?
Motivation
Given that the expect package is modular and published as a standalone package on npm, I'm using it outside of jest and outside of tests. I'm currently trying to use it for implementing a custom mock server for a dev environment. To properly implement this, I need to distinguish expect exceptions from other exceptions, and thus need to do
if (err instanceof JestAssertionError) {}
However this is not currently possible seen as I can't import JestAssertionError from expect
Example
Example
It can't come from anywhere else
Pitch
It can't come from anywhere else
The text was updated successfully, but these errors were encountered: