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 core.debug in testing #163

Closed
tianhaoz95 opened this issue Sep 26, 2019 · 8 comments
Closed

how to disable core.debug in testing #163

tianhaoz95 opened this issue Sep 26, 2019 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@tianhaoz95
Copy link

Is there a way to disable core.debug when I am running jest locally? It is not so helpful to have all the logs on when running regression test.

@bryanmacfarlane bryanmacfarlane added the question Further information is requested label Oct 2, 2019
@bryanmacfarlane
Copy link
Member

The current model is for the action to emit the output and the runner to conditionally add to logs based on setting.

Can you clarify whether you want a way to silence during E2E testing or unit testing etc...?

@tianhaoz95
Copy link
Author

Unit testing. For a node.js action, locally when i run jest --quiet, if I have some core.debug in my code, it will still print out to my console. I am guessing it is because jest doesn't recognize lower level logging. Is there a way that I can set some environment variable ACTION_LOG=false to disable that? I know that setting GitHub action secret can do that, but is there a equivalent locally?

@xt0rted
Copy link
Contributor

xt0rted commented Oct 3, 2019

I think this is a duplicate of #118

@tianhaoz95
Copy link
Author

@xt0rted I think you are right. What is the final decision? jest config or some alternative?

@ericsciple
Copy link
Contributor

would mocking the core module make more sense?

@ericsciple
Copy link
Contributor

Example here where core is mocked out specifically to capture info.

Example here where core is mocked out to control the function results.

Users can leverage mocking tools to fit their specific needs.

@bryanmacfarlane bryanmacfarlane self-assigned this Jan 4, 2020
@bryanmacfarlane
Copy link
Member

Assigning to myself to update docs and guidance pointing to the examples ☝️

@thboop
Copy link
Collaborator

thboop commented Apr 29, 2021

dupe of #118

@thboop thboop closed this as completed Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants