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

Make console clearing with --watch optional #2959

Closed
Billy- opened this issue Feb 21, 2017 · 14 comments · Fixed by #3294
Closed

Make console clearing with --watch optional #2959

Billy- opened this issue Feb 21, 2017 · 14 comments · Fixed by #3294

Comments

@Billy-
Copy link
Contributor

Billy- commented Feb 21, 2017

I am using jest --watch in a docker container, which runs alongside some other development services on docker (namely webpack). When the tests re run, the console gets cleared (I understand this is desired behavior). Problem is, that gets rid of the logs from my other services. I really think that clearing the console should be optional, perhaps via an opt-out flag (jest --watch --no-clear or something).

@Billy-
Copy link
Contributor Author

Billy- commented Feb 21, 2017

In addition to this, (related because the problem I'm trying to solve would only apply to scenarios where the output needs to be logged out, not just viewed) it would be cool to make the interactive element (press p to filter by a filename... etc.) optional as well - as it's not possible to use this when viewing the logs through docker-compose, so is kinda confusing/misleading.

@cpojer
Copy link
Member

cpojer commented Feb 21, 2017

You can use "CI=true jest --watch" which should work for this use-case.

@cpojer cpojer closed this as completed Feb 21, 2017
@Billy-
Copy link
Contributor Author

Billy- commented Feb 22, 2017

@cpojer Is there any documentation for this? I have just tried and it makes no difference for me...

@Billy-
Copy link
Contributor Author

Billy- commented Feb 24, 2017

Can anyone provide any other insight on this issue? @cpojer's solution above didn't make any difference 😖

@Billy- Billy- mentioned this issue Mar 8, 2017
@thymikee thymikee reopened this Mar 8, 2017
@thymikee
Copy link
Collaborator

thymikee commented Mar 8, 2017

it would be cool to make the interactive element (press p to filter by a filename... etc.) optional as well

This will be resolved in the next release: #3078

@Billy-
Copy link
Contributor Author

Billy- commented Mar 8, 2017

@thymikee it will make it nicer too look at, but in a situation where it's not possible to interact at all (such as ci pipelines or, in my case, running inside docker), I was suggesting that this feature should be deactivated altogether.

@Billy-
Copy link
Contributor Author

Billy- commented Mar 8, 2017

Can anyone provide any other insight on my original issue - stopping the console from being cleared? Running CI=true jest --watch did not seem to make any difference for me. Is it possible I am doing something wrong?

@thymikee
Copy link
Collaborator

thymikee commented Mar 8, 2017

So currently there's no option to do that in watch mode, because of this line: https://github.com/facebook/jest/blob/v19.0.2/packages/jest-cli/src/watch.js#L101

Maybe we could make it configurable, what do you think @cpojer?

@Billy-
Copy link
Contributor Author

Billy- commented Apr 11, 2017

Hi @cpojer, any reason this was closed again? There doesn't seem to be any resolution/fix? You still haven't replied to my comments aimed at you above?

cc @thymikee

Many thanks.

@cpojer
Copy link
Member

cpojer commented Apr 11, 2017

I'm sorry, I meant to add some context but got side-tracked. I don't think at this point we'll be adding support for this feature, so I closed this issue.

@Billy-
Copy link
Contributor Author

Billy- commented Apr 11, 2017

That's a shame. I can't use jest with my current stack because of this. 👎

Also note another person with the same issue: #3213

@cpojer
Copy link
Member

cpojer commented Apr 11, 2017

Hmm, that's not great. Maybe we should figure out what workaround might work for you. I'm a bit unsure why "CI=true jest --watch" didn't work. That may actually be a Jest bug, so I'm gonna reopen this issue but we'd appreciate PRs to fix this.

@cpojer cpojer reopened this Apr 11, 2017
@Billy-
Copy link
Contributor Author

Billy- commented Apr 11, 2017

Ah, that's brilliant! Last time I was deving into the code base I was a bit overwhelmed but I'll take another look this week and try to get a PR submitted.

@github-actions
Copy link

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.
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 May 13, 2021
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 a pull request may close this issue.

3 participants