diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 4a886ec99272..b7812b6a1035 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -115,6 +115,10 @@ export default defineConfig({ text: 'Mocking Requests', link: '/guide/mocking-requests' }, + { + text: 'Debugging', + link: '/guide/debugging' + }, /* TODO { text: 'Using Plugins', diff --git a/docs/guide/debugging.md b/docs/guide/debugging.md new file mode 100644 index 000000000000..3c54cc9dff51 --- /dev/null +++ b/docs/guide/debugging.md @@ -0,0 +1,29 @@ +# Debugging + +## VSCode + +To debug a test file in VSCode, create the following launch configuration. + +``` +{ + // 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": "pwa-node", + "request": "launch", + "name": "Debug Current Test File", + "autoAttachChildProcesses": true, + "skipFiles": ["/**", "**/node_modules/**"], + "program": "${workspaceRoot}/node_modules/vitest/vitest.mjs", + "args": ["run", "${relativeFile}"], + "smartStep": true, + "console": "integratedTerminal" + } + ] +} +``` + +Then in the debug tab ensure 'Debug Current Test File' is selected, you can then open the test file you want to debug and press F5 to start debugging. \ No newline at end of file