🎥 Make videos programmatically with React
Fix Studio discovery fetch invocation
Igor Samokhovets8b66aea21cdb
diff --git a/packages/studio-protocol/src/studio-discovery.ts b/packages/studio-protocol/src/studio-discovery.tsindex b033be6cbc..d8d52423d1 100644--- a/packages/studio-protocol/src/studio-discovery.ts+++ b/packages/studio-protocol/src/studio-discovery.ts@@ -202,12 +202,13 @@ export const discoverStudios = async (}> => {let foundUnsupportedProtocol = false;let foundInvalidResponse = false;+ const {fetchFn} = dependencies;const studios = await Promise.all(dependencies.ports.map(async (port): Promise<DiscoveredStudio | null> => {const origin = `http://localhost:${port}`;let response: Response;try {- response = await dependencies.fetchFn(`${origin}/api/studio-protocol`, {+ response = await fetchFn(`${origin}/api/studio-protocol`, {cache: 'no-store',});} catch {diff --git a/packages/studio-protocol/src/test/install-in-studio.test.ts b/packages/studio-protocol/src/test/install-in-studio.test.tsindex 72f0e7a675..d2d421799b 100644--- a/packages/studio-protocol/src/test/install-in-studio.test.ts+++ b/packages/studio-protocol/src/test/install-in-studio.test.ts@@ -195,7 +195,12 @@ test('returns an actionable result when no Studio is running', async () => {});test('waits for Studio discovery while local network permission is pending', async () => {- const fetchFn = (input: string | URL | Request, options?: RequestInit) => {+ const fetchFn = function (+ this: void,+ input: string | URL | Request,+ options?: RequestInit,+ ) {+ expect(this).toBeUndefined();const url = String(input);if (url === 'http://localhost:3000/api/studio-protocol') {return new Promise<Response>((resolve, reject) => {