Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Post Timeline

I am using the javascript test-runner "Mocha".

I have a test that is failing, so I would to debug it using console.log.

But when the tests are run, there is no output ( onlyonly the test results from Mocha). It seems like Mocha has captured and suppressed my console.logconsole.log output! How

How can I get Mocha to show my output? (at for tests that fail)?

EDIT:EDIT:

Huge apologies! -- console.log does work during tests! I must have been expecting it to suppress the output, and I didn't properly check my own code. Thanks for responding. So...that that being said...maybe maybe it actually would be nice to suppress the output for tests that pass? hmm...

On a related note: I want to use console.logconsole.log because I am having a lot of trouble trying to get the Eclipse debugger to connect to node.js Am.

Am I the only one who finds this tricky? How do you guys debug node.js? with With a debugger, or with console.logconsole.log statements?

I am using the javascript test-runner "Mocha"

I have a test that is failing, so I would to debug it using console.log

But when the tests are run, there is no output ( only the test results from Mocha). It seems like Mocha has captured and suppressed my console.log output! How can I get Mocha to show my output? (at for tests that fail)?

EDIT:

Huge apologies! -- console.log does work during tests! I must have been expecting it to suppress the output, and I didn't properly check my own code. Thanks for responding. So...that being said...maybe it actually would be nice to suppress the output for tests that pass? hmm...

On a related note: I want to use console.log because I am having a lot of trouble trying to get the Eclipse debugger to connect to node.js Am I the only one who finds this tricky? How do you guys debug node.js? with a debugger, or with console.log statements?

I am using the javascript test-runner "Mocha".

I have a test that is failing, so I would to debug it using console.log.

But when the tests are run, there is no output (only the test results from Mocha). It seems like Mocha has captured and suppressed my console.log output!

How can I get Mocha to show my output? (at for tests that fail)?

EDIT:

Huge apologies! console.log does work during tests! I must have been expecting it to suppress the output, and I didn't properly check my own code. Thanks for responding. So... that being said... maybe it actually would be nice to suppress the output for tests that pass? hmm...

On a related note: I want to use console.log because I am having a lot of trouble trying to get the Eclipse debugger to connect to node.js.

Am I the only one who finds this tricky? How do you guys debug node.js? With a debugger, or with console.log statements?

edit after realizing that my premise is false and i am an idiot
Source Link
Nick Perkins
  • 8.4k
  • 7
  • 43
  • 40

I am using the javascript test-runner "Mocha"

I have a test that is failing, so I would to debug it using console.log

But when the tests are run, there is no output ( only the test results from Mocha ). It seems like Mocha has captured and suppressed my console.log output! How can I get Mocha to show my output? (at for tests that fail)?

EDIT:

Huge apologies! -- console.log does work during tests! I must have been expecting it to suppress the output, and I didn't properly check my own code. Thanks for responding. So...that being said...maybe it actually would be nice to suppress the output for tests that pass? hmm...

On a related note: I want to use console.log because I am having a lot of trouble trying to get the Eclipse debugger to connect to node.js Am I the only one who finds this tricky? How do you guys debug node.js? with a debugger, or with console.log statements?

I am using the javascript test-runner "Mocha"

I have a test that is failing, so I would to debug it using console.log

But when the tests are run, there is no output ( only the test results from Mocha ). It seems like Mocha has captured and suppressed my console.log output! How can I get Mocha to show my output? (at for tests that fail)?

I am using the javascript test-runner "Mocha"

I have a test that is failing, so I would to debug it using console.log

But when the tests are run, there is no output ( only the test results from Mocha ). It seems like Mocha has captured and suppressed my console.log output! How can I get Mocha to show my output? (at for tests that fail)?

EDIT:

Huge apologies! -- console.log does work during tests! I must have been expecting it to suppress the output, and I didn't properly check my own code. Thanks for responding. So...that being said...maybe it actually would be nice to suppress the output for tests that pass? hmm...

On a related note: I want to use console.log because I am having a lot of trouble trying to get the Eclipse debugger to connect to node.js Am I the only one who finds this tricky? How do you guys debug node.js? with a debugger, or with console.log statements?

Source Link
Nick Perkins
  • 8.4k
  • 7
  • 43
  • 40

Testing javascript with Mocha - how can I use console.log to debug a test?

I am using the javascript test-runner "Mocha"

I have a test that is failing, so I would to debug it using console.log

But when the tests are run, there is no output ( only the test results from Mocha ). It seems like Mocha has captured and suppressed my console.log output! How can I get Mocha to show my output? (at for tests that fail)?

lang-js

AltStyle によって変換されたページ (->オリジナル) /