Skip to content

test: add export-boundary unit tests for @stackbilt/ci, classify, validate, and surface #167

@stackbilt-admin

Description

@stackbilt-admin

Problem

The CLAUDE.md OSS policy requires: "every public export must have test coverage."

An audit of export boundaries found four packages with untested public exports:

Package Untested export(s) Risk
@stackbilt/ci setOutput, setSummary, annotateDriftViolations, annotateValidationStatus, formatPRCommentall 5 exports have zero unit tests High: these are the GitHub Actions integration helpers; regressions are invisible until CI breaks in a consumer
@stackbilt/classify formatChangeClassification() Medium: markdown formatter; output format is a contract for CLI display and MCP consumers
@stackbilt/validate classifyMessage() boundary behavior Medium: governs how commit messages are classified; edge-case failures are silent
@stackbilt/surface formatSurfaceMarkdown() Low: display formatter, but exported as public API

Changes

Add dedicated unit test files for each gap:

  • packages/ci/src/__tests__/ci.test.ts — test all 5 CI helper functions with mock @actions/core outputs. Cover: output format, annotation format for drift violations, PR comment markdown structure.
  • packages/classify/src/__tests__/format.test.ts — test formatChangeClassification() output shape for each change type variant.
  • packages/validate/src/__tests__/classify.test.ts — test classifyMessage() with conventional commit examples, edge cases (empty body, missing scope, multi-line).
  • packages/surface/src/__tests__/format.test.ts — test formatSurfaceMarkdown() with zero routes, single route, multi-framework route table.

Acceptance

  • pnpm test passes with new files included
  • pnpm test --coverage shows 100% line coverage on the newly-tested exports
  • No existing tests removed or modified

Notes

These tests are split-stable — @stackbilt/ci, @stackbilt/classify, @stackbilt/validate, and @stackbilt/surface are all governance-only packages that carry forward unchanged in any @stackbilt/build commercial split. Safe to write now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:p1Should ship this cyclev0.13Targeted for Charter v0.13

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions