-
-
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
Let stdin be passed through to jest-cli #5017
Comments
Ugh. There's also a simple workaround, sorry. Got too caught up in the problem to see that we can spawn a child process using Node's |
Should it be in the docs? |
Is there a spot you had in mind to document it? I think we'll be OK. This feature is will end up with a PR to extend |
Yeah, might not be any fitting place for it as we don't really document any programmatic APIs |
I still think the original suggestion makes sense |
What concerns me a bit is that the |
Should we go ahead and add a CLI option then? I don't really want to add clutter, but it seems to be the best spot for our use case and to document the feature. Non-raw mode is called "cooked" or "canonical" but it could also be "rare". As much as I want to suggest "allow cooked stdin" as an option, how about:
Other than a few more tests, I think that's the scope of the change. |
Maybe we can support piped |
Oooh, brave. 👍 Right now Jest stays open waiting for input that'll never come, right? Can only get better from there. If you enter an unrecognized key in the watch usage prompt there's no action, so we're good on that end too (observed at the prompt, not via a code review). |
Unfortunately, after #4958, no watch usage is shown if jest process is running in non-interactive environment. Since IDEs/tools start jest test runner with redirected streams, no watch usage is shown here. |
I'd like to spawn a jest-cli child-process dynamically but it simply breaks on first input. Would be nice to find a permanent solution to this. |
This comment has been minimized.
This comment has been minimized.
This issue is stale because it has been open for 1 year 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. |
Do you want to request a feature or report a bug? A feature
What is the current behavior?
When Jest runs in watch mode,
jest-cli
only listens for input from text terminals that send characters one at a time in "raw mode". This dependency ontty.ReadStream#setReadMode
injest/packages/jest-cli/src/watch.js
prevents anyone who's spawned Jest as a child process from interacting with the watcher (e.g.: IDE extensions likevscode-jest
).What is the expected behaviour?
How do you feel about using
setRawMode
when it's available, and letting whatever data through if a feature toggle is set (e.g.: a CLI arg orprocess.env
)? Any thoughts on the feature toggle?Suggested change:
From:
To:
On my end it's the lowest overhead of:
stdin
that's piped inwatch.js
to extract the dependency on input methodThanks!
The text was updated successfully, but these errors were encountered: