mirror of
https://github.com/hanzoai/msw.git
synced 2026-09-24 17:00:34 +00:00
* chore: adopt "tsup" * chore: copy worker with tsup * chore: bundle iife correctly, fix call frames * chore: inject "setTimeout" for node build * chore: log worker checksum * chore(postinstall): use early return over process.exit
9 lines
349 B
TypeScript
9 lines
349 B
TypeScript
import { setTimeout as nodeSetTimeout } from 'timers'
|
|
|
|
// Polyfill the global "setTimeout" so MSW could be used
|
|
// with "jest.useFakeTimers()". MSW response handling
|
|
// is wrapped in "setTimeout", and without this polyfill
|
|
// you'd have to manually advance the timers for the response
|
|
// to finally resolve.
|
|
export const setTimeout = nodeSetTimeout
|