-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Feature]: Jest-Cli exports some util APIs #12456
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
@adamma1024 sorry, missed this. You're basically wanting #5048. However, we can export those APIs you imported from |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Proposal:
jest-cli
package exportbuildArgv
API andinit
API, or adding callback/plugin system.https://github.com/facebook/jest/blob/356b3b05b77f927b49e151302edbef6594d09a22/packages/jest-cli/src/cli/index.ts#L51-L86
https://github.com/facebook/jest/blob/34308ae21827a44916471106b4e3afdb3779cbb1/packages/jest-cli/src/init/index.ts#L40-L155
Motivation
My purpose is to do something else when invoke
run
API ofjest-cli
, like this:As we can see, if I want to let it to work well, I should import
buildArgv
API andinit
API fromjest-cli/build/cli/index
andjest-cli/build/init
After v27, I noticed that
jest-cli
did not export them anymore. I'm so agreed that it's a great idea to just export APIs which were introduced in the document. But how can I solve this problem in an easy way? I think that I can only rewrite ajest-cli
to finish it.Which sounds so stupid.
So, can
jest-cli
support this workaround by exporting some util APIs, or adding a callback/plugin system?Example
By
exports
inpackage.json
( the easiest way I think ):By
plugin system/ callback
:Pitch
The most important point is that I think jest really need a plugin system( or callback ) to ensure users can do something else easier.
The second point is a little "selfish" because jest doing that is really easier than me, lol. Otherwise, I must rewrite
jest-cli
in my project to do that.The text was updated successfully, but these errors were encountered: