valendres / playwright-msw

A Mock Service Worker API for Playwright
MIT License
162 stars 22 forks source link

Delay is ignored #45

Closed SetupCoding closed 1 year ago

SetupCoding commented 1 year ago

Using a handler like

export const getAccountMSW = () => [
  rest.get('http://localhost:8080/account', (_req, res, ctx) => {
    return res(ctx.delay(1000), ctx.status(200, 'Mocked status'), ctx.json(getAccountMock()));
  }),
];

in msw results in times around one second: image

When using playwright-msw with the same handler the delay seems to be ignored (1-6ms RTT)

image

SetupCoding commented 1 year ago

The fix works. Would love to see it in the next release :D