Skip to content

Commit ce38173

Browse files
committed
Fix lint
1 parent 938d4e3 commit ce38173

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/compass-intercom/src/setup-intercom.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ function createMockFetch({
1818
integrations,
1919
}: {
2020
integrations: Record<string, boolean>;
21-
}) {
22-
return async (url) => {
21+
}): typeof globalThis.fetch {
22+
return (url) => {
2323
if (typeof url !== 'string') {
2424
throw new Error('Expected url to be a string');
2525
}
2626
if (url.startsWith(FAKE_HADRON_AUTO_UPDATE_ENDPOINT)) {
2727
if (url === `${FAKE_HADRON_AUTO_UPDATE_ENDPOINT}/api/v2/integrations`) {
28-
return {
28+
return Promise.resolve({
2929
ok: true,
30-
async json() {
31-
return integrations;
30+
json() {
31+
return Promise.resolve(integrations);
3232
},
33-
} as Response;
33+
} as Response);
3434
}
3535
} else if (url === 'https://widget.intercom.io/widget/appid123') {
3636
// NOTE: we use 301 since intercom will redirects
3737
// to the actual location of the widget script
38-
return { status: 301 } as Response;
38+
return Promise.resolve({ status: 301 } as Response);
3939
}
4040
throw new Error(`Unexpected URL called on the fake update server: ${url}`);
4141
};

0 commit comments

Comments
 (0)