From 2a1dd8e5536a4e6aef89ff279807d32fd844fda5 Mon Sep 17 00:00:00 2001 From: gbockus-sf <76090802+gbockus-sf@users.noreply.github.com> Date: Mon, 21 Mar 2022 14:51:02 -0500 Subject: [PATCH] feat: add flow for creating LWC jest debug config (#3920) * feat: add flow for creating LWC jest debug config * feat: changes from review. remove typescript as option for debugger * fix: update text for debug description based on review * chore: update windows path for sfdx-lwc-jest --- packages/salesforcedx-vscode-lwc/package.json | 32 +++++++++++++++++++ .../salesforcedx-vscode-lwc/package.nls.json | 4 ++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/salesforcedx-vscode-lwc/package.json b/packages/salesforcedx-vscode-lwc/package.json index 31aaf97fe3..db7f7ab681 100644 --- a/packages/salesforcedx-vscode-lwc/package.json +++ b/packages/salesforcedx-vscode-lwc/package.json @@ -356,6 +356,38 @@ "title": "%force_lightning_lwc_test_stop_watching_all_tests_text%" } ], + "debuggers": [ + { + "type": "vscode-lwc-tests", + "label": "%force_lightning_lwc_debugger%", + "languages": [ + "javascript" + ], + "configurationSnippets": [ + { + "label": "%force_lightning_lwc_debugger%", + "description": "%force_lightning_lwc_debugger_desc%", + "body": { + "name": "%force_lightning_lwc_debugger%", + "type": "node", + "request": "launch", + "program": "^\"\\${workspaceFolder}/node_modules/.bin/sfdx-lwc-jest\"", + "args": [ + "--", + "--runInBand" + ], + "cwd": "^\"\\${workspaceFolder}\"", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "disableOptimisticBPs": true, + "windows": { + "program": "^\"\\${workspaceFolder}/node_modules/@salesforce/sfdx-lwc-jest/bin/sfdx-lwc-jest\"" + } + } + } + ] + } + ], "configuration": { "type": "object", "title": "%force_lightning_lwc_preferences%", diff --git a/packages/salesforcedx-vscode-lwc/package.nls.json b/packages/salesforcedx-vscode-lwc/package.nls.json index bb2a77d5fd..a2f537227e 100644 --- a/packages/salesforcedx-vscode-lwc/package.nls.json +++ b/packages/salesforcedx-vscode-lwc/package.nls.json @@ -18,5 +18,7 @@ "force_lightning_lwc_test_stop_watching_all_tests_text": "SFDX: Stop Watching All Lightning Web Component Tests", "force_lightning_lwc_preferences": "Salesforce Lightning Web Components", "force_lightning_lwc_remember_device_description": "Remember most recently used mobile device target.", - "force_lightning_lwc_mobile_log_level": "Log level used when calling SFDX Preview on Mobile command." + "force_lightning_lwc_mobile_log_level": "Log level used when calling SFDX Preview on Mobile command.", + "force_lightning_lwc_debugger": "Debug: LWC Jest Tests", + "force_lightning_lwc_debugger_desc": "Debug configuration for running LWC jest tests in VSCode." }