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

Support outputFile option for listTests option #14980

Conversation

manoraj
Copy link
Contributor

@manoraj manoraj commented Mar 21, 2024

Fixes #14943

Closes #14944 (Closed it due to CLA issues)

🚀 Feature Proposal
Right now, the --listTests option will just write the list of tests to the console. My proposal is to use the --outputFile option along with the --listTests option to write the output to the file.

Motivation
We wanted to use the list of tests in the custom sequencers. This feature will help to store the list in the file so that the sequencers can access it.

Note that this is just my usecase. There may be different use cases as well.

Example
Pass --outputFile=test-lists.json along with --listTests

yarn test --listTests --json --outputFile=test-lists.json

Copy link

netlify bot commented Mar 21, 2024

Deploy Preview for jestjs ready!

Name Link
🔨 Latest commit 5a79268
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/66011fd69f1483000884e16c
😎 Deploy Preview https://deploy-preview-14980--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.

@manoraj
Copy link
Contributor Author

manoraj commented Mar 25, 2024

@SimenB Can you approve this PR

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.

thanks!

@SimenB SimenB merged commit b3093f6 into jestjs:main Mar 25, 2024
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 Apr 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: outputFile support for listTests option
2 participants