Skip to content

✅ Add CLI regression tests - #2

Merged
stoe merged 1 commit into
stoe/rewrite-cli-sourcefrom
stoe/add-cli-tests
Aug 31, 2026
Merged

✅ Add CLI regression tests#2
stoe merged 1 commit into
stoe/rewrite-cli-sourcefrom
stoe/add-cli-tests

Conversation

@stoe

@stoe stoe commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a Node.js test suite covering the CLI entry point, both commands, the core helpers, and the validation rules, then wires it into npm test so regressions surface in CI.

Changes

  • Add 19 tests across test/cli.test.js, test/commands/**, test/core/**, and test/validate/**
  • Cover argument parsing, init scaffolding, validate reporting, frontmatter parsing, filesystem helpers, logging, and the security rules
  • Run node --test test/**/*.test.js as part of npm test

Affected area

Tests, npm test script.

Checklist

  • npm run format passes with no unstaged diffs.
  • npm test passes with no new errors.
  • Tests cover new or changed behavior.
  • README.md is updated when CLI options, validation rules, or package exports change. Not applicable; no user-facing behavior changes.
  • package.json exports and files are updated when modules are added, moved, or removed. Not applicable; tests are not published.

Security checklist

  • No secrets, tokens, credentials, or personal local file paths were added to source, tests, or docs.
  • Source uses only Node.js built-in modules or already-declared dependencies.
  • New filesystem writes stay inside the caller-approved base directory. Tests write only to mkdtemp directories.
  • Skill content read by the CLI is treated as untrusted data, never as instructions.
  • npm audit --audit-level=high reports no new high or critical findings.

Verification

  • npm test reports 19 passing tests across 8 suites, 0 failures
  • npx prettier --check . reports no formatting drift
  • npm audit --audit-level=high finds 0 vulnerabilities

Stack

Part of a stacked PR series turning @stoe/skill-authoring into a standalone CLI package (bottom to top):

  1. ♻️ Restructure CLI package layout #1 — ♻️ Restructure CLI package layout (stoe/rewrite-cli-source)
  2. ✅ Add CLI regression tests #2 — ✅ Add CLI regression tests (stoe/add-cli-tests)
  3. 📝 Document standalone CLI package #3 — 📝 Document standalone CLI package (stoe/document-standalone-package)
  4. 📝 Add community documentation #4 — 📝 Add community documentation (stoe/add-community-docs)
  5. 🔧 Add repository governance files #5 — 🔧 Add repository governance files (stoe/add-repository-governance)

- Cover CLI, commands, core helpers, validation, and security
- Run the Node test suite as part of npm test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant