Debugging Vue Jest unit tests in VSCode

I converted the cli option to just debug. Add these to your files. The prelaunch task was needed for me since I kept running into cached file issues, but it may not be required for everyone so try without that flag too.

The i flag as noted in the stackoverflow answer is critical to ensure the process runs in the same debug process.


    "version": "0.2.0",
    "configurations": [{
        "type": "node",
        "request": "launch",
        "name": "Run Tests",
        "env": { "VUE_CLI_BABEL_TARGET_NODE": "true",
                 "VUE_CLI_BABEL_TRANSPILE_MODULES": "true" },
        "program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
        "args": ["-i"],
        "preLaunchTask": "npm: clear-jest-cache",


    "scripts": {
        "clear-jest-cache": "./node_modules/jest/bin/jest.js --clearCache"