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

  • 4
    I would like to run the JavaScript test in debug mode not the contract
    – Micha Roon
    Apr 8, 2017 at 9:34
  • apparently I had a reading skills fail. sorry about that.
    – Paul S
    Apr 8, 2017 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 Mar 23, 2018 at 9:54
  • 5
    5 people marked as duplicate, but the question is different.@DrGorb test is debug mode as opposed to debugging the contract. Apr 4, 2018 at 12:31
  • I switched to hardhat because of this issue
    – Micha Roon
    Dec 21, 2021 at 23:10

1 Answer 1


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.