Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add flow for creating LWC jest debug config #3920

Merged
merged 10 commits into from
Mar 21, 2022
32 changes: 32 additions & 0 deletions packages/salesforcedx-vscode-lwc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\"",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will forward slashes for windows as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so but intend to verify. I did some splunking at https://github.com/jest-community/vscode-jest/blob/e3dbd7299a13730b34697601a10e323ba6286649/package.json#L337 and followed their existing pattern.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gbockus-sf - I'm the QA for this story as well. I will run a sanity check on windows today.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been fighting it this AM. I think there will be an update required for windows. Will keep you posted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jag-sfdc verified with circle build 31400 we are good on windows 👍

"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%",
Expand Down
4 changes: 3 additions & 1 deletion packages/salesforcedx-vscode-lwc/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}