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

How to disable "Determining test suites to run" text? #4465

Closed
ljharb opened this issue Sep 12, 2017 · 8 comments
Closed

How to disable "Determining test suites to run" text? #4465

ljharb opened this issue Sep 12, 2017 · 8 comments

Comments

@ljharb
Copy link
Contributor

ljharb commented Sep 12, 2017

It looks like the initial text "Determining test suites to run" only can be hidden by "not being a TTY" or by "being CI".

Is there any way a custom reporter could suppress this information?

I'm trying to parse the output, and this additional (colored) output makes it more difficult. Currently I can set CI=true or similar, but this is only a temporary workaround - I'd like it to be implied by the custom reporter, if possible.

@cpojer
Copy link
Member

cpojer commented Sep 12, 2017

We could change it, but we are writing this before creating the TestRunner which manages the reporters. Do you need information while the test run is ongoing and this is why you cannot rely on --json? It would be great if Jest had an interactive mode that streams JSON.

@ljharb
Copy link
Contributor Author

ljharb commented Sep 12, 2017

In this case, I don't want the user to have to specify --json - JSON is a built-in reporter; I want a custom one.

In other words, I want to ensure that the only output jest produces, period, comes from the custom reporter.

@cpojer
Copy link
Member

cpojer commented Sep 12, 2017

Yeah, that makes sense to me. Happy to review PRs for this :)

@ljharb
Copy link
Contributor Author

ljharb commented Sep 12, 2017

Do you have any suggestions about where to start?

It seems like constructing the TestRunner earlier, and then calling a new instance method that takes the default output and returns a Promise for the actual output (ie, undefined would output nothing) would work?

If so, should this instance method only control this output, or should it be generic enough to control all output? One possible signature is (type: <some enum>, defaultOutput: String) => Promise<String> (or whatever the type notation is supposed to be).

Thoughts?

@cpojer
Copy link
Member

cpojer commented Sep 13, 2017

I'm going to merge this into #4471 because @aaronabramov is exploring how to expand reporters and take them out of the lifecycle of TestRunner. I recommend following up with him on that task.

@cpojer cpojer closed this as completed Sep 13, 2017
@cpojer
Copy link
Member

cpojer commented Sep 13, 2017

^ I should add @aaronabramov was planning on doing this this week.

@aaronabramov
Copy link
Contributor

i was experimenting with it last night.. and i think it would be awesome to only print to stdout/stderr from reporters and ship the default reporter in a modular way (maybe as a separate package) so it can be extended/modified.

i was able to get 95% of it done, the only problem we have with that is that our globalConfig is not immutable and changes throughout the flow. Once we get this fixed we can fully switch to using reporters for any logging.

@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

No branches or pull requests

3 participants