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

后端 未结 5 2157
名媛妹妹
名媛妹妹 2020-12-13 16:31

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

5条回答
  •  旧时难觅i
    2020-12-13 17:24

    If you are testing asynchronous code, you need to make sure to place done() in the callback of that asynchronous code. I had that issue when testing http requests to a REST API.

提交回复
热议问题