v0.1.0
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 legacyrest.*APIs. - Scan real API calls from
fetch,window.fetch,globalThis.fetch, and commonaxioscall 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.*andrest.*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 checknpm run build