mirror of
https://github.com/hanzoai/msw.git
synced 2026-09-24 17:00:34 +00:00
19 lines
506 B
TypeScript
19 lines
506 B
TypeScript
import { test, expect } from '../playwright.extend'
|
|
|
|
test('parses request URL parameters', async ({ loadExample, fetch }) => {
|
|
await loadExample(new URL('./params.mocks.ts', import.meta.url))
|
|
|
|
const res = await fetch(
|
|
'https://api.github.com/users/octocat/messages/abc-123',
|
|
)
|
|
const status = res.status()
|
|
const body = await res.json()
|
|
|
|
expect(status).toBe(200)
|
|
expect(res.fromServiceWorker()).toBe(true)
|
|
expect(body).toEqual({
|
|
username: 'octocat',
|
|
messageId: 'abc-123',
|
|
})
|
|
})
|