Skip to content

v0.1.0

Choose a tag to compare

@felmonon felmonon released this 25 Mar 01:28

msw-inspector v0.1.0

Initial release of msw-inspector, a CLI and GitHub Action for finding gaps in MSW mock coverage.

Highlights

  • Scan MSW handlers from http.* and legacy rest.* APIs.
  • Scan real API calls from fetch, window.fetch, globalThis.fetch, and common axios call shapes.
  • Compare handlers against actual API usage and report:
    • mocked API calls
    • unmocked API calls
    • stale handlers
    • unsupported dynamic patterns
  • Emit both text output and stable JSON output with schemaVersion: 1.
  • Ship a thin GitHub Action that publishes job summaries and optional sticky PR comments from the CLI JSON report.

Install

npm install -D msw-inspector

Example

npx msw-inspector --report-file msw-inspector.json --format json

First-release scope

This release is intentionally narrow and static-analysis-first. It favors explicit unsupported diagnostics over guessing at dynamic patterns.

Included in v0.1.0:

  • direct MSW http.* and rest.* handler extraction
  • static string, template, regex, and URL-based matcher resolution
  • same-file axios.create(...) instance support
  • coverage matching by HTTP method and normalized path

Not included yet:

  • custom API wrapper inference
  • cross-file constant resolution
  • GraphQL, WebSocket, or SSE analysis
  • baseline coverage deltas in the GitHub Action

Validation

Verified locally with:

  • npm run check
  • npm run build

Repository

https://github.com/felmonon/msw-inspector