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

Add flag to force Node colors #713

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

artemave
Copy link

@artemave artemave commented Jul 2, 2019

So that process that runs in Electron renderer process can log to the terminal if it runs in a headless mode, but to the browser console if it runs with the browser window.

Use case: run browser tests in electron-mocha renderer with or without browser window and still have colors in both cases.

This change also FIXES MASTER. It changes default browser output from console.debug to console.log because the former seems to require a non-default log level to actually output things.

https://developer.mozilla.org/en-US/docs/Web/API/Console :
image

In the browser, `console.debug` does not output anything by default. From MDN (https://developer.mozilla.org/en-US/docs/Web/API/Console):

"Starting with Chromium 58 this method only appears in Chromium browser consoles when level "Verbose" is selected."
artemave added a commit to featurist/electron-mocha that referenced this pull request Jul 2, 2019
When/if [this pr](debug-js/debug#713) is
merged, this change will allow to correctly output terminal colors from
the [debug module](https://www.npmjs.com/package/debug)

Also here: proxy all relevant renderer `console.*` methods to the main process
`console`.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.9%) to 86.792% when pulling 6404365 on artemave:master into 5c7c61d on visionmedia:master.

@coveralls
Copy link

coveralls commented Jul 2, 2019

Coverage Status

Coverage decreased (-0.9%) to 86.792% when pulling e407309 on artemave:master into 5c7c61d on visionmedia:master.

So that process that runs in Electron renderer process can log to
the terminal if it runs in a headless mode, but to the browser console
if it runs with the browser window.

Use case: run browser tests in electron-mocha renderer with or without
browser window.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants