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

Conversation

gbockus-sf
Copy link
Contributor

What does this PR do?

Add a new debugger configuration for LWC jest tests.

A few items to note that were different from how the tickets was written.

  1. There is a @salesforce/lwc-jest-test module that is included in our default and analytics packages so no need to worry about verifying jest or the config existing.
  2. For an empty project with the current change the user will need to add the module from 1 in order to run the test.

What issues does this PR fix or reference?

@W-10536658@

Functionality Before

No debug configuration available for LWC jest tests

Functionality After

Screen Shot 2022-03-15 at 12 33 44 PM

@gbockus-sf gbockus-sf marked this pull request as ready for review March 15, 2022 22:08
@gbockus-sf gbockus-sf requested a review from a team as a code owner March 15, 2022 22:08
@gbockus-sf gbockus-sf requested review from jag-j and a team March 15, 2022 22:08
"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 configuretion for running LWC jest tests in vscode."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screen Shot 2022-03-15 at 5 28 41 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"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 👍

@gbockus-sf gbockus-sf merged commit 2a1dd8e into develop Mar 21, 2022
@gbockus-sf gbockus-sf deleted the gbockus/add-lwc-jest-debug branch March 21, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants