# @dowser/http-testing

Standalone fetch/XHR controller for regular Jest and Vitest tests, used alongside [dowser](https://github.com/getdowser/dowser). Provides the same manual-flush controller API the on-device half offers, backed by `@mswjs/interceptors` (the primitive MSW itself sits on top of). Installing this package does not pull in MSW the mock-server.

## Install

```bash
yarn add -D @dowser/http-testing
```

## Usage

```ts
import {installHttpController, waitForHttp} from '@dowser/http-testing';

const http = installHttpController();
http.expectOne('/api/me').reply({id: 'u1'});
// ...drive your component...
await waitForHttp(http, {url: '/api/me'});
```

See https://github.com/getdowser/dowser for the full guide.
