Skip to content

Reorganize test files to root directory - #1

Closed
reportbase wants to merge 1 commit into
mainfrom
claude/practical-cannon-zktdyc
Closed

reportbase wants to merge 1 commit into
mainfrom
claude/practical-cannon-zktdyc

Conversation

@reportbase

Copy link
Copy Markdown
Owner

This PR reorganizes the test infrastructure by moving test files from the test/ subdirectory to the project root.

Summary

Simplified the project structure by consolidating test files into the root directory, reducing directory nesting and making the test setup more straightforward.

Key Changes

  • Updated import paths in worker.test.mjs to reference modules from the root (./worker.js and ./auth.js instead of ../src/worker.js and ../src/auth.js)
  • Updated the schema path reference in d1.mjs to use ./schema.sql instead of ../schema.sql
  • Modified the test script in package.json to run tests from the root directory (*.test.mjs instead of test/*.test.mjs)

Implementation Details

The changes maintain the same test functionality while flattening the directory structure. All relative import paths have been adjusted to reflect the new file locations, ensuring tests can properly locate both the source modules and test utilities.

https://claude.ai/code/session_01Pf84v97TVCpcgwPh8HShvu

npm test looked for test/*.test.mjs and the tests imported from ../src/,
so it ran 0 tests after the files were uploaded to the repo root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pf84v97TVCpcgwPh8HShvu

Copy link
Copy Markdown
Owner Author

Closing as superseded by #2, which is merged. Both PRs fixed the same problem: npm test ran nothing, because the tests imported ../src/ and the files sat at the root. They just went opposite ways. #2 moved the tests into test/, importing from the root, and on main all 30 tests pass and the Deploy run succeeds. Resolving this PR's conflict would only move the files back, so there's nothing left to merge. It can be reopened if the flat layout is preferred.


Generated by Claude Code

@reportbase reportbase closed this Oct 4, 2026
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