Lift The Source of Truth Up
Source is a library that allows you to generate request handlers from various sources, like HAR files or OpenAPI documents.
Take your truth
Record your traffic in the browser or take an OpenAPI specification as the source of truth.
Generate request handlers
Provide the supported input to @mswjs/source
and get the list of request handlers back.
import
{ fromTraffic }
from
'@mswjs/source/traffic'
import
traffic
from
'./recording.har'
const
handlers
=
fromTraffic
(traffic)
Integrate anywhere
Integrate with Mock Service Worker to achieve reliable network reproductions anywhere, anytime.
Try out Source
Source is a useful tool to replay the recorded network traffic when mocking or debugging.
Get started