@zimic/interceptor
Version:
Next-gen TypeScript-first HTTP intercepting and mocking
69 lines (50 loc) • 3.3 kB
Markdown
<p align="center">
<img src="../../docs/zimic.png" align="center" width="100px" height="100px">
</p>
<h1 align="center">
/interceptor
</h1>
<p align="center">
Next-gen TypeScript-first HTTP intercepting and mocking
</p>
<p align="center">
<a href="https://www.npmjs.com/package/@zimic/interceptor">npm</a>
<span> • </span>
<a href="https://zimic.dev">Docs</a>
<span> • </span>
<a href="https://zimic.dev/docs/examples">Examples</a>
<span> • </span>
<a href="https://github.com/zimicjs/zimic/issues">Issues</a>
<span> • </span>
<a href="https://github.com/orgs/zimicjs/projects/1/views/4">Roadmap</a>
</p>
<div align="center">
[](https://github.com/zimicjs/zimic/actions/workflows/ci.yaml)
[](https://github.com/zimicjs/zimic/actions)
[](https://github.com/zimicjs/zimic/blob/canary/LICENSE.md)
[](https://github.com/zimicjs/zimic)
[](https://www.npmjs.com/package/@zimic/interceptor)
[](https://bundlephobia.com/package/@zimic/interceptor)
</div>
---
`/interceptor` is a type-safe interceptor library for handling and mocking HTTP requests in development and
testing.
## Highlights
- :globe_with_meridians: **HTTP interceptors**
Use your [`/http` schema](https://zimic.dev/docs/http/guides/schemas) to declare
[local](https://zimic.dev/docs/interceptor/guides/interceptors/local) and
[remote](https://zimic.dev/docs/interceptor/guides/interceptors/remote) HTTP interceptors. Mock external services and
simulate success, loading, and error states with ease and type safety.
- :link: **Network-level interception**
`/interceptor` combines [MSW](https://github.com/mswjs/msw) and
[interceptor servers](https://zimic.dev/docs/interceptor/cli/server) to handle real HTTP requests. From you
application's point of view, the mocked responses are indistinguishable from the real ones.
- :bulb: **Readability**
`/interceptor` was designed to encourage clarity and readability. Declare intuitive mocks, test with confidence,
and verify that your application is making the expected requests with
[declarative assertions](https://zimic.dev/docs/interceptor/guides/declarative-assertions).
**Learn more**:
- [`/interceptor` - Getting started](https://zimic.dev/docs/interceptor/getting-started)
- [`/interceptor` - Guides](https://zimic.dev/docs/interceptor/guides)
- [`/interceptor` - API](https://zimic.dev/docs/interceptor/api)
- [`/interceptor` - CLI](https://zimic.dev/docs/interceptor/cli)