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

Silent Mode #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Silent Mode #45

wants to merge 1 commit into from

Conversation

KyleW
Copy link

@KyleW KyleW commented Nov 18, 2019

Adds a silent mode. When silentMode is true, it skips the logging when mapping describe blocks to filenames.

SilentMode defaults to false so existing users should not see a change.

@strille
Copy link

strille commented Nov 20, 2019

I agree that the logging of the describe blocks are annoying.

An alternative solution to the silentMode flag would be to send the logger (log) to getFilesForDescriptions and have it use that instead of calling console.log. Then the describe blocks can be printed using log.debug(). Anyone interested in that output can simply increase the loglevel.

@KyleW
Copy link
Author

KyleW commented Nov 20, 2019

I like that Idea better. I'll switch it to using log.debug.

@KyleW
Copy link
Author

KyleW commented Nov 20, 2019

I looked into it and log.debug doesn't seem to be an option without a bigger refactor. Currently, the library doesn't use a logger other than what comes with node. As far as I can tell, there's nothing like log.debug available. I'd have to add winston or something to get log levels and even then I think I'd need to expose a log level flag.

I could switch from console.log to console.debug, but I believe those do exactly the same thing. 🤷‍♂

@strille
Copy link

strille commented Nov 21, 2019

I was thinking you could send in the log created for the reporter as an argument to fileUtil.getFilesForDescriptions, and use that:
fileUtil.getFilesForDescriptions(testPaths, testFilePattern, log)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants