Skip to content

test: group test files by feature - #1030

Merged
PathGao merged 2 commits into
masterfrom
tests-by-feature
Oct 26, 2026
Merged

PathGao merged 2 commits into
masterfrom
tests-by-feature

Conversation

@PathGao

@PathGao PathGao commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

scripts/ had ~200 test files, one per fix. This merges them into a few files per feature area (tabs, navigation, windows, documents, editor, editing, preview, export, layout, shortcuts, settings, release): <feature>.test.ts / <feature>.spec.ts for behavior tests, <feature>.checks.* for the cases that read source as text, and <feature>.<area>.* where a part must run in its own process (module mocks, process-wide shims). 203 files become 58.

No assertion changed and no test changed runner. Each old file's cases sit in a describe with their setup moved into hooks, so one file's globals do not leak into another's. AGENTS.md now says where a new test goes, and comments, docs and the test:frontmatter / test:workflows scripts name the merged files.

Verified: the sorted list of test names reported by node --test and vitest is identical before and after (1752 names), all pass; vitest --sequence.shuffle green; svelte-check 0 errors; cargo test green.

Merge the ~200 per-fix test files into a few files per feature area.
Source-reading cases move to <feature>.checks.* files, separate from
behavior tests. No assertion changed: the same 1752 test names pass.
…iles

AGENTS.md gains a 'Where a test goes' section: tests are grouped by
feature, a new case joins its feature's file, and a new file is for a new
feature or an isolated area. Comments, docs and package.json scripts that
named the old per-fix files now name the file the case moved to.
@PathGao
PathGao merged commit eeab952 into master Oct 26, 2026
4 checks passed
@PathGao
PathGao deleted the tests-by-feature branch October 26, 2026 12:03
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.

1 participant