Bare bones setup to debug tests
Add $NODE_DEBUG_OPTION
to script you want to debug, so package.json
has a following section:
{
"scripts": {
"test": "mocha $NODE_DEBUG_OPTION"
}
}
- Open Run > Edit Configurations... dialog.
- Add New Configuration (Alt+Insert), a green plus button at top-left.
- Select npm.
- Name is whatever, e.g. test.
- For Scripts select
test
. - Click OK.
- Debug this configuration using a bug icon at top-right corner of the main window.