docs: name the two kinds of test in scripts/, and ask which one a PR added - #563
Merged
Conversation
…added `npm test` has been described as "the behavior tests" since the suite was three files. It is now 109, and 31 of them import nothing from `src/` — they match the source text instead. Both kinds are useful, but they fail differently: a source-shape assertion goes red on a rename that broke nothing, and stays green on a change that broke something, because what it checks is whether a line is still spelled a certain way. Calling the whole suite behavior tests hides that, and the cost is a reader — human or agent — treating a green run as coverage it isn't. So AGENTS.md names both kinds, and the pull request template asks which one you added and what its anchor is. Pinning a Tauri command name, an i18n key or a duplicated implementation is what source-shape assertions are for; pinning an internal call site is not. The template also says out loud that not every fix needs a test, which nothing here said before. No test files change. This is documentation of what the suite already is. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 10, 2026
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.
What this is
Two documentation edits, no code and no test files touched.
AGENTS.mdstops callingscripts/*.test.ts"the behavior tests" and names what is actually in there.Mechanism
The description in
AGENTS.mddates from when the suite was small enough for it to be true. Counting the tree today: 109 test files, and 31 of them import nothing fromsrc/— they match the source text with a regex or an AST walk. Another 53 do both.Both kinds are worth having, but they fail in opposite directions:
A source-shape assertion checks whether a line is still spelled a certain way. That is exactly right when the spelling is the contract and the compiler cannot see it —
invoke('read_file_content')has to match a Rust function name,t('common.save')has to match a dictionary key,mermaid.render(must not acquire a third call site (singleImplementationConvention.test.tsexists for that). It is wrong when the anchor is an internal call, where a rename is free and pinning it makes ordinary refactoring fail the suite for no behavioural reason.Calling the whole suite "behavior tests" hides that distinction, and the cost lands on the next reader — human or agent — who reads a green run as coverage it isn't.
Scope
Deliberately left alone:
AGENTS.mdgets no methodology, only the corrected description. What counts as worth testing is a judgement that belongs in review, not in a file that mostly states facts about the build.Tests
None, and none are possible: nothing in
scripts/readsAGENTS.mdor the pull request template (grep -rln 'AGENTS.md\|PULL_REQUEST_TEMPLATE' scripts/is empty). By the criterion this PR adds, a docs change with no silent failure mode does not get one.Verification
Documentation only — no source file changes, so
npm run checkandcargo testhave nothing new to see and CI runs them anyway. Both edited files were re-read in full after editing.Not verified: how the template renders in GitHub's PR compose box. The added text is plain paragraphs inside an existing
##section, so it follows whatever the four sections above it already do.🤖 Generated with Claude Code