From 5767c2fdc53733a209059c23a53025d5ded31906 Mon Sep 17 00:00:00 2001 From: Jaco du Preez Date: Sun, 2 Aug 2026 18:55:22 +0200 Subject: [PATCH] fix: repair broken plugin test invocation in docs and package.json (#95) CONTRIBUTING.md, README.md, and AGENTS.md all instructed contributors to run `node .opencode/plugins/tests/test-.mjs` directly, which fails: the .mjs test files import .ts sources and require the tsx ESM loader (`node --import tsx --test ...`). Additionally, the existing `npm run test:plugins` script (the intended correct alternative) was itself broken -- it passed a bare directory to `node --test`, which fails under the tsx loader with ERR_MODULE_NOT_FOUND trying to resolve a nonexistent index.ts. Fixed it to use the same working glob as the `test` script. Docs now consistently point to `npm run test:plugins` / `npm test`, and stale test counts (129+ -> 158) were corrected alongside. Verified: `npm run test:plugins` now runs successfully -> 158/158 PASS (previously threw ERR_MODULE_NOT_FOUND immediately). --- AGENTS.md | 4 ++-- CONTRIBUTING.md | 2 +- README.md | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3cfe80a..5032466 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -245,8 +245,8 @@ Before merging to `development`, the CI must pass: - All agent files have required frontmatter and sections - All skill files have valid cross-references to existing agents - All command files reference valid skill directories -- **Plugin tests** (`node .opencode/plugins/tests/test-*.mjs`): - - 11 test suites, 129+ tests covering all hooks +- **Plugin tests** (`npm run test:plugins`): + - 18 test suites, 158 tests covering all hooks ## Notes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 708f86c..9cc1972 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ pi 2. Discuss the approach with maintainers 3. Fork the repo and create a branch 4. Make your changes -5. Run the plugin tests: `node .opencode/plugins/tests/test-.mjs` +5. Run the plugin tests: `npm run test:plugins` (needs the `tsx` ESM loader — a plain `node .opencode/plugins/tests/test-.mjs` will fail, since the tests import `.ts` sources) 6. Submit a pull request ## Commit Conventions diff --git a/README.md b/README.md index 7919c19..c077a27 100644 --- a/README.md +++ b/README.md @@ -346,7 +346,7 @@ All 12 bash hooks from CCGS ported to `ccgs-hooks.ts`: | 11 | `post-compact.sh` | `experimental.compaction.autocontinue` | **5** | | 12 | `notify.sh` | Utility (`showNotification`) | — | -> 🧪 Run plugin test suite: `node .opencode/plugins/tests/test-.mjs` +> 🧪 Run plugin test suite: `npm run test:plugins` (needs the `tsx` ESM loader — see CONTRIBUTING.md) > 🧪 Run workflow integrity suite: `node tests/workflow/run-all.mjs` ### Contributing to the Framework diff --git a/package.json b/package.json index 68c3383..848ccfa 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "scripts": { "test": "node --import tsx --test .opencode/plugins/tests/test-*.mjs", - "test:plugins": "node --import tsx --test .opencode/plugins/tests/", + "test:plugins": "node --import tsx --test .opencode/plugins/tests/test-*.mjs", "test:framework": "node tests/agents/validate.mjs", "test:parity": "node --import tsx --test tests/e2e/test-parity.test.ts" },