Bug
npm test fails on a fresh clone because the test suite hardcodes one developer-specific checkout path.
Reproduction
- Clone this repository anywhere other than
/Users/dkundel/code/codex-plugin
- Run:
- Observe failures like:
ENOENT: no such file or directory, open '/Users/dkundel/code/codex-plugin/plugins/codex/commands/review.md'
MODULE_NOT_FOUND for /Users/dkundel/code/codex-plugin/plugins/codex/scripts/codex-companion.mjs
Root Cause
Both test files set ROOT to an absolute path instead of deriving it from the checked-out repository location:
tests/commands.test.mjs
tests/runtime.test.mjs
That makes the suite depend on the original author's local filesystem layout.
Impact
- New contributors cannot run the full test suite successfully on their own machines.
- CI or any clean environment will fail unless it happens to mirror that exact path.
- Real regressions are masked by path-related failures.
Suggested Fix
Resolve the repo root relative to the test files at runtime, for example via import.meta.url, and add a regression check that does not depend on a machine-specific absolute path.
Bug
npm testfails on a fresh clone because the test suite hardcodes one developer-specific checkout path.Reproduction
/Users/dkundel/code/codex-pluginnpm testENOENT: no such file or directory, open '/Users/dkundel/code/codex-plugin/plugins/codex/commands/review.md'MODULE_NOT_FOUNDfor/Users/dkundel/code/codex-plugin/plugins/codex/scripts/codex-companion.mjsRoot Cause
Both test files set
ROOTto an absolute path instead of deriving it from the checked-out repository location:tests/commands.test.mjstests/runtime.test.mjsThat makes the suite depend on the original author's local filesystem layout.
Impact
Suggested Fix
Resolve the repo root relative to the test files at runtime, for example via
import.meta.url, and add a regression check that does not depend on a machine-specific absolute path.