Skip to content
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

Update testMatch to also be compatible with Jest 24 #6313

Merged
merged 2 commits into from
Apr 16, 2019

Conversation

ngbrown
Copy link
Contributor

@ngbrown ngbrown commented Jan 31, 2019

For people who try to use Jest 24, there is a different version of micromatch and it behaves differently. These changes should make it behave the same before and after changing Jest versions.

Without this change, Jest 24 will come up with no files to test.

I tested with npm run test -- --listTests on two projects, one with the default Jest 23 and another with the new Jest 24. In addition to numerous normally named test files had some special case files like src/.test.js, src/test.js, and src/somethingtest.js. Only the first two matched and the third one didn't; both pre-, and post- this change.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@mrmckeb
Copy link
Contributor

mrmckeb commented Feb 1, 2019

Hi @ngbrown, thanks for that. I think this change should be accompanied by a move to Jest 24... but I agree it's necessary for that. Let's hold off until that time, if that's OK?

@mrmckeb mrmckeb self-assigned this Feb 1, 2019
@ngbrown
Copy link
Contributor Author

ngbrown commented Feb 1, 2019

I submitted this separate because Jest 24 isn't quite ready (jestjs/jest#7707) to be pulled into create-react-app. Because Jest 24 has better support for TypeScript people might want to try it out. Since this is one of the first things they will run into, it might as well be fixed for everyone.

Being able to merge now is why I made sure the new pattern would work equivalently in the older micromatch.

@SimenB
Copy link
Contributor

SimenB commented Feb 14, 2019

If jest 24 is blocked until a new major, it'd be a good idea to land this in the meantime

@stale
Copy link

stale bot commented Mar 16, 2019

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Mar 16, 2019
@ianschmitz
Copy link
Contributor

I'm not sure this is still needed as we've landed Jest 24 and from my quick tests it seems to be working okay.

@SimenB can you advise? Should we make this change?

@stale stale bot removed the stale label Mar 16, 2019
@SimenB
Copy link
Contributor

SimenB commented Mar 16, 2019

If you've tested on windows and it works, this shouldn't be needed

@ianschmitz ianschmitz added this to the 3.0 milestone Mar 16, 2019
@dalcib
Copy link
Contributor

dalcib commented Mar 17, 2019

I tested CRA version 3.0.0-next.b0cbf2ca on windows, and it is not detecting any tests.
This PR solves the problem.

@ianschmitz ianschmitz merged commit 207d931 into facebook:master Apr 16, 2019
@lock lock bot locked and limited conversation to collaborators Apr 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants