github mswjs/msw v0.20.2

latest releases: v2.6.5, v2.6.4, v2.6.3...
4 years ago

Features

  • Adds graphql.link request handler that allows to mock GraphQL operations on per-endpoint basis (#315, #319).
import { setupWorker, graphql } from 'msw'

const github = graphql.link('https://api.github.com/graphql')
const stripe = graphql.link('https://api.stripe.com/graphql')

const worker = setupWorker(
  github.query('GetUser', resolver),
  stripe.mutation('Payment', resolver),
)

worker.start()

Bug fixes

  • Fixes a TypeScript issue that resulted into the following error (#321, #322):
ERROR in node_modules/msw/lib/types/context/cookie.d.ts:1:8 - error TS1192:
Module '"/node_modules/@types/cookie/index"' has no default export.

Don't miss a new msw release

NewReleases is sending notifications on new releases.