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

console.debug is missing #687

Closed
quantizor opened this issue Jan 21, 2016 · 5 comments
Closed

console.debug is missing #687

quantizor opened this issue Jan 21, 2016 · 5 comments

Comments

@quantizor
Copy link
Contributor

I have a feeling it somehow relates to: https://github.com/facebook/jest/blob/master/src/Console.js

But trying to use console.debug() in a test tells me it isn't there, but .warn(), .log(), and .error() work as expected.

@cpojer
Copy link
Member

cpojer commented Jan 21, 2016

There is no real reason to include this because it just maps to console.log. I actually didn't even know it existed. If you need this, I'd recommend doing console.debug = console.log in your setup env file or in the beforeEach call of your associated test. I don't think I'll add this to jest.

@cpojer cpojer closed this as completed Jan 21, 2016
@douglasryanadams
Copy link

For others looking for a similar thing. I'm using 'loglevel' for browser logging and got my logs back while running Jest by doing this (as suggested above):

In the "jest" config (in package.json):

"setupFiles": [
    "./jest-setup.js"
],

At the same directory level as 'package.json', created a file called 'jest-setup.js' which contained:

var log = require('loglevel');

log.info = console.log;
log.debug = console.log;
log.trace = console.log;
console.debug = console.log;
console.trace = console.log;
console.info = console.log;

It's not perfect, but I see everything I want.

@SimenB
Copy link
Member

SimenB commented Mar 3, 2018

console.debug has been implemented in Jest since #5350 (available in jest 22.1.4)

@nfantone
Copy link

nfantone commented Jun 15, 2018

Jan 2016 -> "I don't think I'll add this to jest. There is no real reason."
Mar 2018 -> "console.debug has been implemented in Jest".

Lulz.

@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 12, 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

5 participants