Debugging in Visual Studio Code using SuiteCloud CLI for Node.js

If you are using SuiteCloud CLI for Node.js integrated in Visual Studio Code, you can debug your test files in the IDE.

For more information about unit testing in SuiteCloud projects, see SuiteCloud Unit Testing in GitHub.

To debug in Visual Studio Code using SuiteCloud CLI for Node.js

  1. Create a JSON file in the .vscode folder with the following code:

                    {
          "version": "0.2.0",
          "configurations": [
             {
            "type": "node",
            "request": "launch",
            "name": "Debug Jest Tests",
            "skipFiles": ["<node_internals>/**"],
             "args": ["--runInBand", "--config=${workspaceFolder}\\jest.config.js"],
            "console": "integratedTerminal",
            "program": "${workspaceFolder}\\node_modules\\jest\\bin\\jest"
            }
          ]
    } 
    
                  
    Note:

    This example works in Windows. If you use Unix, you only need to adjust the paths syntax.

  2. Save it as launch.json.

  3. Launch Visual Studio Code, and open the test file corresponding to the file you want to debug.

  4. Add a breakpoint in a line of your test file, and press the Debug icon button.

Related Topics

SuiteCloud CLI for Node.js Guide
SuiteCloud CLI for Node.js Installation Prerequisites
Supported SuiteCloud CLI for Node.js Versions
Supported Command-Line Interpreters for SuiteCloud CLI for Node.js
Installing SuiteCloud CLI for Node.js
Setting Up SuiteCloud CLI for Node.js
About the Project Structure in SuiteCloud CLI for Node.js
SuiteCloud Unit Testing with Jest

General Notices