docs: say in CONTRIBUTING that a change comes with a test - #33
Merged
Conversation
The Tests section explained how to write a good test — prove it fails against
the unfixed code, do not verify a rule with the same rule — but never said that a
change should bring one. The habit is universal here and the suite has grown with
every behavioural change; it was simply not written down.
The other three extensions in this account already state it ("New behaviour needs
a test"), so this is the odd one out rather than a new rule.
Named the destination too, since "which suite" is the question that follows: pure
logic mirrors its path under tests/, and anything that depends on what VS Code
actually does with a handler belongs in fixtures/extension-host — which is the
distinction that caught the fire-and-forget semantics of handleTextEditor.
Verified: quality.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Tests section explained how to write a good test — prove it fails against
the unfixed code, do not verify a rule with the same rule — but never said that a
change should bring one.
The habit is universal here and the suite has grown with every behavioural
change. It was simply not written down, and the other three extensions in this
account already state it ("New behaviour needs a test"), so this repository was
the odd one out rather than the strict one.
Why name the destination
"Which suite" is the question that immediately follows. Pure logic mirrors its
path under
tests/; anything that depends on what VS Code actually does with ahandler belongs in
fixtures/extension-host.That distinction is not academic — it is what caught
handleTextEditorbeingfire-and-forget, which the fake had been happily awaiting.
Context
Found while answering the OpenSSF Best Practices criteria, where
test_policyasks whether the requirement is documented. It was the only one of the four
repositories that could not answer yes.
Verification
quality.🤖 Generated with Claude Code