MSW request verification assertions for Bupkis.
See also: README
import { use } from 'bupkis';import mswAssertions, { createTrackedServer } from '@bupkis/msw';import { http, HttpResponse } from 'msw';const { expect } = use(mswAssertions);{ using server = createTrackedServer( http.get('/api/users', () => HttpResponse.json([])), ); server.listen(); await fetch('http://localhost/api/users'); expect(server, 'to have handled request to', '/api/users'); // server.close() called automatically} Copy
import { use } from 'bupkis';import mswAssertions, { createTrackedServer } from '@bupkis/msw';import { http, HttpResponse } from 'msw';const { expect } = use(mswAssertions);{ using server = createTrackedServer( http.get('/api/users', () => HttpResponse.json([])), ); server.listen(); await fetch('http://localhost/api/users'); expect(server, 'to have handled request to', '/api/users'); // server.close() called automatically}
Factory, types, and utilities for MSW servers with request tracking.
MSW request verification assertions for Bupkis.
See also: README
Example