10

as a developer I want to run my javascript test in a debugger so as to be able to step through tests and inspect the values of variables.

The goal is to run it in a Mocha debug mode

  • 3
    I would like to run the JavaScript test in debug mode not the contract – Micha Roon Apr 8 '17 at 9:34
  • apparently I had a reading skills fail. sorry about that. – Paul S Apr 8 '17 at 17:35
  • There is a solution - it is possible to use node inspector to debug tests (as well as IDEs such as VSCode). I posted the details about node inspector here - ethereum.stackexchange.com/a/43633/36407 – Boris Serebrov Mar 23 '18 at 9:54
  • 4
    5 people marked as duplicate, but the question is different.@DrGorb test is debug mode as opposed to debugging the contract. – Mars Robertson Apr 4 '18 at 12:31
6

Due to the way Truffle interacts with Mocha's API (i.e. programmatically), there are only a handful of options we can specify in the mocha config in our truffle.js file (grep, ui, reporter, timeout, bail, useColors, retries, slow, ignoreLeaks, fullTrace).

I would also like this functionality, so I raised the issue over at the Mocha repo.

Note that this is not a direct answer to your question, but I can't comment in this stackexchange forum due to my current reputation level; just wanted to share my research.

Not the answer you're looking for? Browse other questions tagged or ask your own question.