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
11 changes: 9 additions & 2 deletions src/libs/E2E/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ const defaultRequestInit: RequestInit = {
headers: defaultHeaders,
};

const sendRequest = (url: string, data: Record<string, unknown>): Promise<Response> =>
fetch(url, {
const sendRequest = (url: string, data: Record<string, unknown>): Promise<Response> => {
// Don't process these specific API commands because running them over and over again in the tests hammers the server in a bad way.
if (url.includes('command=OptInToPushNotifications') || url.includes('command=OptOutOfPushNotifications')) {
console.debug('Skipping request to opt in or out of push notifications');
return Promise.resolve(new Response());
}

return fetch(url, {
method: 'POST',
headers: {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -46,6 +52,7 @@ const sendRequest = (url: string, data: Record<string, unknown>): Promise<Respon
throw new Error(errorMsg);
});
});
};

/**
* Submits a test result to the server.
Expand Down