Skip to content

Commit

Permalink
feat: add trigger for loggin mocked response by msw
Browse files Browse the repository at this point in the history
  • Loading branch information
timepresent95 committed Aug 9, 2024
1 parent e959e73 commit 2d1ffc9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/mocks/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@ export async function initMSW() {
}
await import('./msw.polyfills');
const {server} = await import('./server');
server.listen();
server.listen({onUnhandledRequest: 'bypass'});
server.events.on('response:mocked', ({request, response}) => {
console.log(
'%s %s received %s %s',
request.method,
request.url,
response.status,
response.statusText,
);
});
}

0 comments on commit 2d1ffc9

Please sign in to comment.