Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion tests/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ import { handlers as resendHandlers } from './resend.ts'

export const server = setupServer(...resendHandlers, ...githubHandlers)

server.listen({ onUnhandledRequest: 'warn' })
server.listen({
onUnhandledRequest(request, print) {
// Do not print warnings on unhandled requests to https://<:userId>.ingest.us.sentry.io/api/
// Note: a request handler with passthrough is not suited with this type of url
// until there is a more permissible url catching system
// like requested at https://github.com/mswjs/msw/issues/1804
if (request.url.includes('.sentry.io')) {
return
}

// Print the regular MSW unhandled request warning otherwise.
print.warning()
}
})

if (process.env.NODE_ENV !== 'test') {
console.info('🔶 Mock server installed')
Expand Down