mirror of
https://github.com/hanzoai/msw.git
synced 2026-09-24 17:00:34 +00:00
20 lines
495 B
TypeScript
20 lines
495 B
TypeScript
import * as JSONBig from 'json-bigint'
|
|
import { test, expect } from '../../../playwright.extend'
|
|
|
|
test('uses a custom transformer to parse BigInt in response body', async ({
|
|
loadExample,
|
|
fetch,
|
|
}) => {
|
|
await loadExample(new URL('./custom-transformers.mocks.ts', import.meta.url))
|
|
|
|
const res = await fetch('/user')
|
|
const body = await res.text()
|
|
|
|
expect(body).toEqual(
|
|
JSONBig.stringify({
|
|
username: 'john.maverick',
|
|
balance: BigInt(1597928668063727616),
|
|
}),
|
|
)
|
|
})
|