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

chore: test using existing command #5331

Merged
merged 5 commits into from
Jan 22, 2024
Merged

Conversation

WillieRuemmele
Copy link
Member

@WillieRuemmele WillieRuemmele commented Jan 11, 2024

What does this PR do?
adds a new command for generating a "basic" apex unit test, just the test class and annotation

What issues does this PR fix or reference?
@W-14709113@

Functionality Before
would have to generate an apex class with a large header comment, and test method

Functionality After
just generate a ready-to-go apex unit test

requires: forcedotcom/salesforcedx-templates#575
used by: https://github.com/forcedotcom/salesforcedx-vscode-einstein-gpt/pull/325

@peternhale
Copy link
Contributor

@WillieRuemmele if I read this correctly, ED4will be calling the a command execute directly with the basic template name and if run from command palette, the command will use the decorated template.

If this is the case, I like it!

@WillieRuemmele
Copy link
Member Author

correct, here's the accompanying PR in E4D

looks like the command name has changed since we first started with it anyways

@WillieRuemmele WillieRuemmele marked this pull request as ready for review January 11, 2024 22:04
@WillieRuemmele WillieRuemmele requested a review from a team as a code owner January 11, 2024 22:04
@peternhale
Copy link
Contributor

@WillieRuemmele Thanks for going the extra mile to avoid a new command. All that is missing are unit tests. Could you have a look here.

@WillieRuemmele
Copy link
Member Author

@peternhale added tests, hard to get many assertions because everything was mocked. I thought this approach would have a lot of breaking changes, and be harder to integrate, glad it's easier this way

Copy link
Contributor

@floralan floralan left a comment

Choose a reason for hiding this comment

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

Good work!

✅ QA has passed.

  1. This command should not be exposed in the command palette ✅
  2. Confirm the unit test template generated by sfdx.apex.generate.unit.test.class doesn’t change ✅

@WillieRuemmele WillieRuemmele merged commit 9782d81 into develop Jan 22, 2024
12 checks passed
@WillieRuemmele WillieRuemmele deleted the wr/basicUnitTestTemplate branch January 22, 2024 22:02
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.

3 participants