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

Fixes bug #13222 #13319

Merged
merged 8 commits into from
Nov 16, 2023
Merged

Fixes bug #13222 #13319

merged 8 commits into from
Nov 16, 2023

Conversation

brunocabral88
Copy link
Contributor

Summary

This PR is supposed to fix bug #13222 (--filter option not working as per documentation suggests)

Currently, the --filter option expected an object with shape { filtered: { test: Array<string> } }, even though the documentation suggests it expects { filtered: Array<string> }, so this commit fixes this inconsistency by making the code behave as the documentation suggests.
Please note this may be a breaking change for users using this feature as the expected output object shape changed.

Test plan

Create a filter.js file, which exports a function as per the --filter documentation, then use it with jest --filter=filter.js and see if jest properly filtered the test files as it should.

Also, a unit test has been added to packages/jest-core/src/__tests__/SearchSource.test.ts.

@mrazauskas
Copy link
Contributor

mrazauskas commented Sep 25, 2022

Good to see a PR to fix this issue.

Keep I mind that merging it as suggested would introduce a breaking change for the current users. This can only happen with the next major release, which is months away. It is a good idea to simply the API, but this will take time.

I would say, at the moment a better idea would be to edit the documentation so that it would reflect the actual behaviour.

@brunocabral88
Copy link
Contributor Author

@mrazauskas yeah, I believe this PR should go in the next major (I can create another one for adjusting the docs).
Should I just leave this one here to be picked up for the next major? First time contributing here so not sure..

@SimenB
Copy link
Member

SimenB commented Sep 25, 2022

Thanks for the PR! However, I think it makes more sense to align the docs with the implementation than the other way around, like you discuss.

Should I just leave this one here to be picked up for the next major?

Yep, I'll add it to a milestone 🙂

@SimenB SimenB added this to the Jest 30 milestone Sep 25, 2022
@brunocabral88
Copy link
Contributor Author

Thanks for adding it to the milestone @SimenB :)
As suggested, I've created another PR to update the docs accordingly.

@legobeat

This comment was marked as outdated.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 20, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@netlify
Copy link

netlify bot commented Sep 20, 2023

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e32d042
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/6555ecce294c4100089bc921
😎 Deploy Preview https://deploy-preview-13319--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've resolved the conflicts 🙂

can you update the docs to be reference being a string again, and add a changelog entry?

@brunocabral88
Copy link
Contributor Author

Done @SimenB. If any other change is needed, just let me know. 😃

@legobeat
Copy link

lint:fix should show how to satisfy prettier

@SimenB SimenB merged commit 3e86cf3 into jestjs:main Nov 16, 2023
72 of 73 checks passed
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2023
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.

5 participants