Skip to content

Testing

You need Node 24.

npm ci --ignore-scripts
npm run check

npm run check is the whole gate, in the order CI runs it:

Step What it proves
npm run lint Biome's recommended lint rules pass
npm run typecheck the sources and tests typecheck under strict settings
npm run bundle dist/index.js is built from src/index.ts with esbuild, and CI fails when the committed file differs
npm test the unit, host, pack and fixture tests
npx plugin-kit check conformance T0 and T1, the doc file set, the forbidden patterns and no bundled kit
npx plugin-kit docs --check every generated doc section matches the manifest

The suites

Suite Proves
test/accounts.test.ts one MCP server per alias, the default server and a bad-alias refusal
test/provider.test.ts the pages, cursors, scope, probe and refusals
test/handlers.test.ts every handler's answer, checked with the contract's own consumer check
test/fixture.test.ts every recorded conformance answer replays through the handlers without drift
test/manifest.test.ts the package name, the 71-method table by class, the 68 pass-through tools against the recorded tool list, the source and the handler table
test/host.test.ts the tested range and the clean HOST_UNTESTED refusal
test/host/skills.test.ts every skills/*/SKILL.md is registered on the real OpenCode 2.4.1 host
test/pack/pack.test.ts the packed tarball's files, an install with scripts disabled and the server entry it exports
test/unit/docs.test.ts the install tag, the tested range in the README, the changelog and the docs layout
test/unit/notice.test.ts every package in the bundle has its heading and licence text in NOTICE
test/unit/skills.test.ts the frontmatter of every skill, every YAML block form and a malformed file's refusal
test/unit/repository-style.test.ts the README's sections and links, the docs site and its jobs, and no legacy word

Fixtures

fixtures/conformance.json is the plugin's evidence to the conformance kit. npm run fixtures rebuilds it from the deterministic fake Metaview MCP executor in test/support/, and test/fixture.test.ts replays every recorded answer through the handlers so the fixture cannot drift.

The plugin has no real Metaview workspace in CI. Once one exists, record from two real accounts with npx plugin-kit record --account work and --account personal, and delete scripts/record-fixture.mjs. plugin-kit record redacts credentials, emails, phone numbers and home directories before it writes.

The contract pin

package.json pins the contract to the release tag github:we-the-rebel-alliance/plugin-contract#v0.1.1, and moves the pin with the contract's release. Never copy a contract module into this repository.

The committed package-lock.json records the contract's repository over git+https, so a fresh npm ci needs no SSH key. Keep it that way; CI also rewrites an ssh://git@github.com/ URL to HTTPS for an older lockfile.

The docs site

python3 -m venv .cache/docs-venv
.cache/docs-venv/bin/pip install -r docs/requirements.txt
.cache/docs-venv/bin/mkdocs build --strict

The virtual environment lives in .cache, outside the tree plugin-kit check scans, and Git ignores it. Every page is in the nav: mkdocs build --strict fails on one that is not, and on a relative link that does not resolve.

Contributing

CONTRIBUTING.md has the pull request rules, the manifest-first order for a new capability and the release steps.