-
-
Notifications
You must be signed in to change notification settings - Fork 27k
How to extend expect() globally with Jest? #2007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can probably do this in |
Thanks! Seems promising.. I tried this in src/setupTests.js
Then...
I got...
And I couldn't see the console.log statement. |
Have you ejected by any chance? |
@jiv-e can you provide
Worked for me! Can you confirm this ? |
@gaearon, in fact yes. I have ejected. Does it cause some side effects? Here's the project I'm working on: https://github.com/jiv-e/preact-widget-boilerplate. I understand if the issue is out of the scope of create-react-app. @anilreddykatta, you can find the package.json from above repo. Or if you want, you can clone it and try it out. I couldn't get your example to work. |
is missing in your
Let me know if it helps! |
Yea, that’s the reason. If you haven’t used |
Should we include this in the documentation? I am unable to find where it is mentioned about this? |
Add what exactly? |
@gaearon If we don't use |
Thank you very much @gaearon and @anilreddykatta! This is now resolved. |
@anilreddykatta we should probably mention that feature is only available pre-eject and that it requires manual configuration post-eject. Would you be willing to put together a PR based on @gaearon's response? |
@Timer Sure. I will do that. 👍 |
I'm already working on this. |
@jiv-e Sure. That would be great! |
Hi!
First, thank you!!! Create React App is an awesome resource and great documentation is big part of it. Still after searching for answer and trying different things I couldn't find a solution.
I would like to extend expect() with expect-element. Is this possible to do globally?
The text was updated successfully, but these errors were encountered: