Skip to content

Error "step is not defined' when debugging in Visual studio code #27

@nathalok

Description

@nathalok

When I tried to debug a mocha test in Visual Studio Code its throwing the following error -
ReferenceError: step is not defined

Below is the copy of my launch.json file used for debug configuration and that should reproduce the error

Launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

    {
        "type": "node",
        "request": "launch",
        //"skipFiles": [
          //  "<node_internals>/**"
          //],
        "name": "Mocha Tests",            
        "program": "${workspaceRoot}/node_modules/mocha/bin/mocha",
        "args": [                                
            "${workspaceFolder}/test/MyTests/sampleTest.js",                                
            "--require mocha-steps"
        ],
        "port": 9229,
        "internalConsoleOptions": "openOnSessionStart",
        "env": {
            // Used to select the config file from config folder. 
            // It should be same as the file name.
            "NODE_ENV": "dev"                 
        }
    }        
]

}


Visual Studio Code and Nodejs version details -

VSCode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions