public/mockServiceWorker.js
Function getResponse
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function getResponse(event, client, requestId) {
const { request } = event
const requestClone = request.clone()
const getOriginalResponse = () => fetch(requestClone)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return event.respondWith(
handleRequest(event, requestId).catch((error) => {
if (error.name === 'NetworkError') {
console.warn(
'[MSW] Successfully emulated a network error for the "%s %s" request.',
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return respondWithMock(clientMessage)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return getOriginalResponse()
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return getOriginalResponse()
- Create a ticketCreate a ticket