Files
msw/test/browser/msw-api/exception-handling.mocks.ts

13 lines
270 B
TypeScript

import { http } from 'msw'
import { setupWorker } from 'msw/browser'
const worker = setupWorker(
http.get('https://api.github.com/users/:username', () => {
// @ts-expect-error nonExisting should not be defined
nonExisting()
return
}),
)
worker.start()