-
Notifications
You must be signed in to change notification settings - Fork 193
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
Fix dubious index check #692
Conversation
Thanks for creating this PR. I don't think we have any unit tests for this part of the code. I don't mind taking this over and making one. The change looks correct. |
This slipped my mind yesterday. I'll check today. |
A bit more complex than I was hoping to create these unit tests, but as we go forward, it should be easier to write them since we can base new ones off of existing tests. |
0eaaaab
to
e4da6ba
Compare
In order to do this, needed to move `databases.test.ts` to the `minimal-workspace` test folder because these tests require that there be some kind of workspace open in order to check on workspace folders. Unfortunately, during tests vscode does not allow you to convert from a single root workspace to multi-root and so several of the workspace functions needed to be stubbed out.
e4da6ba
to
0c2b35f
Compare
@max-schaefer thanks for getting me to create these unit tests. They uncovered a bug! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and thanks for the detailed tests! One question about test organisation.
Did you have a question? I don't see one posted. |
I did write one inline, and it seems to have been lost when I submitted the review... Some of the tests are independent of the workspace, specifically the ones for URI processing. I wonder whether those could remain as |
We could do that. Though I wonder what the benefit would be. I do think it's nice to keep related tests together even if they don't all require a workspace. |
My thinking was that they are unit tests that shouldn't rely on any properties of the workspace, and I'd like them to continue being independent of the workspace. |
Previously, they were part of the |
* Fix dubious index check * Add unit tests for add/remove database In order to do this, needed to move `databases.test.ts` to the `minimal-workspace` test folder because these tests require that there be some kind of workspace open in order to check on workspace folders. Unfortunately, during tests vscode does not allow you to convert from a single root workspace to multi-root and so several of the workspace functions needed to be stubbed out. * Update changelog Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
I'm pretty sure this is meant to check
folderIndex
, notindex
.Can you advise on how to add a test for this? (Of course it's fine if you want to just take over the PR instead.)
Checklist
@github/docs-content-dsp
has been cc'd in all issues for UI or other user-facing changes made by this pull request.