Skip to content

test: mirror flat unit-test trees into src feature subdirs#206

Merged
mtskf merged 1 commit into
mainfrom
chore/mirror-test-trees
Jul 12, 2026
Merged

test: mirror flat unit-test trees into src feature subdirs#206
mtskf merged 1 commit into
mainfrom
chore/mirror-test-trees

Conversation

@mtskf

@mtskf mtskf commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Mirror the flat unit-test trees onto their src/ feature subdirectories so src↔test correspondence no longer costs a search. Pure move — git mv plus relative-import rewrites inside the moved tests; no test logic, src/, or config changes.

Changes

  • test/webview/ (113 files): 80 tests moved into decorations/, fenced-code/, fold/, frontmatter/, image/, inline/, lint/, list/, outline/, paste/, table/, task-checkbox/; 33 cross-cutting / top-level-cm tests stay at the tree root. helpers/ untouched.
  • test/extension/ (50 files): 40 tests moved into commands/, config/, conflict/, handoff/, image/, links/, lint/, session/, surface/; 10 top-level tests (extension.activate, package-*, types-equality, webview-*, …) stay at the root. e2e/ untouched.
  • Every moved file descends exactly one level, so each relative specifier was rewritten uniformly (../../src../../../src, ./helpers../helpers, ./vscode-stub../vscode-stub), including multiline import() / from and vi.mock / new URL forms.
  • No config edits needed: the vitest include glob and the test/webview tsconfig include are recursive; tsconfig.unit.json names only types-equality.test.ts, which stays at the root.

Related

  • TODO: 🧹 Mirror the flat test trees into feature subdirectories — test/webview/ + test/extension/

Test Plan

  • pnpm compile clean (all 4 tsconfigs)
  • pnpm test:unit — 187 files / 3327 tests, identical to the pre-move baseline
  • pnpm test:browser — 9 files / 26 tests pass
  • pnpm lint clean on the moved dirs
  • Resolver audit: every relative specifier in all 121 moved files resolves on disk (catches type-only imports that compile/vitest would strip silently)

Move test/webview/ (113 files) and test/extension/ (50 files) into
subdirectories mirroring their src family dirs (decorations/, lint/,
table/, session/, surface/, …) so src↔test correspondence no longer
costs a search. 121 files move one level deeper; 42 cross-cutting /
top-level tests stay at the tree root. Pure move + relative-import
rewrites — no test logic, src, or config changes. Suite unchanged at
187 files / 3327 tests.
@mtskf mtskf force-pushed the chore/mirror-test-trees branch from cd239eb to 0136fde Compare July 12, 2026 05:25
@mtskf mtskf merged commit a0d01a7 into main Jul 12, 2026
1 check passed
@mtskf mtskf deleted the chore/mirror-test-trees branch July 12, 2026 05:28
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