Skip to content

Convert call sites to use typed commands (part 6): createVSCodeCommandManager in tests#2237

Merged
robertbrignull merged 2 commits intomainfrom
robertbrignull/use_app_commands_6
Mar 30, 2023
Merged

Convert call sites to use typed commands (part 6): createVSCodeCommandManager in tests#2237
robertbrignull merged 2 commits intomainfrom
robertbrignull/use_app_commands_6

Conversation

@robertbrignull
Copy link
Copy Markdown
Contributor

We have quite a few tests that trigger commands as part of them. They do this to call code that isn't accessible otherwise. The easiest way to convert these tests to use typed commands is to use createVSCodeCommandManager to get a real command manager than will trigger real commands. By doing this the the behaviour should be exactly the same except that the commands are type checked.

It would likely be better overall if these tests were able to call code without using commands. That would likely lead to better organised code. However, that is more of a long term goal.

Does this make sense? Or should we put in more effort to refactor the tests? Or something else entirely?

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@robertbrignull robertbrignull requested review from a team as code owners March 24, 2023 17:12
Copy link
Copy Markdown
Member

@koesie10 koesie10 left a comment

Choose a reason for hiding this comment

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

This approach makes sense to me, I don't think we should refactor all tests to call directly into the methods right now.

@robertbrignull robertbrignull requested a review from a team March 28, 2023 13:43
@robertbrignull robertbrignull force-pushed the robertbrignull/use_app_commands_6 branch from 56003ad to 1043448 Compare March 28, 2023 13:58
@robertbrignull robertbrignull merged commit 1e00451 into main Mar 30, 2023
@robertbrignull robertbrignull deleted the robertbrignull/use_app_commands_6 branch March 30, 2023 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants