Skip to content

test: co-locate test files with their source modules#76

Merged
scottlovegrove merged 1 commit into
mainfrom
scottl/colocate-tests
May 21, 2026
Merged

test: co-locate test files with their source modules#76
scottlovegrove merged 1 commit into
mainfrom
scottl/colocate-tests

Conversation

@scottlovegrove
Copy link
Copy Markdown
Contributor

Summary

  • Moved all tests out of src/__tests__/ to sit next to the modules they cover (foo.tsfoo.test.ts).
  • Relocated the shared test fixture to src/_fixtures/auth.ts.
  • Rewrote relative import / vi.mock / dynamic import() specifiers for the new file depths.
  • Updated tsconfig.json exclude (src/**/*.test.ts + src/_fixtures) so colocated tests and fixtures stay out of dist/, and refreshed the testing docs in CLAUDE.md.

No source logic changed — pure relocation. Git tracked every move as a rename so history is preserved.

Test plan

  • npm run type-check clean
  • npm run build clean, no *.test.* / _fixtures artifacts in dist/
  • npm run test — 19 files, 166 tests pass
  • npm run format clean

🤖 Generated with Claude Code

Move tests out of src/__tests__ to sit next to the modules they cover
(foo.ts -> foo.test.ts) and relocate shared fixtures to src/_fixtures.
Rewrite relative import/mock specifiers for the new depths, and update
tsconfig exclude so colocated tests and fixtures stay out of dist/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove self-assigned this May 21, 2026
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR effectively reorganizes the test suite by co-locating test files with their corresponding source modules and updating the necessary configuration and imports to match. This restructuring is a great organizational improvement that will enhance maintainability and make navigating the codebase much easier. No issues were flagged during the review.

Share FeedbackReview Logs

@scottlovegrove scottlovegrove merged commit 4553357 into main May 21, 2026
5 checks passed
@scottlovegrove scottlovegrove deleted the scottl/colocate-tests branch May 21, 2026 12:49
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.

2 participants