fix: repair broken plugin test invocation in docs and package.json (#95) - #102
Merged
Merged
Conversation
CONTRIBUTING.md, README.md, and AGENTS.md all instructed contributors to run `node .opencode/plugins/tests/test-<name>.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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #95.
CONTRIBUTING.md, README.md, and AGENTS.md all instructed contributors to run
node .opencode/plugins/tests/test-<name>.mjsdirectly — fails immediately with a SyntaxError, since the.mjstest files import.tssources and need thetsxESM loader.Found a second, deeper bug while fixing this: the existing
npm run test:pluginsscript (the documented correct alternative) was itself broken — it passed a bare directory tonode --test, which throwsERR_MODULE_NOT_FOUNDtrying to resolve a nonexistent.opencode/plugins/tests/index.tsunder the tsx loader. Fixed the script inpackage.jsonto use the same working glob (test-*.mjs) as thetestscript.Docs now consistently point to
npm run test:plugins, and a stale nearby test count (129+ -> 158) was corrected alongside.Verification
npm run test:pluginspreviously threwERR_MODULE_NOT_FOUNDon invocation; now runs to completion: 158/158 PASS.