diff --git a/integration-test/jest/src/hooks.test.jsx b/integration-test/jest/src/hooks.test.jsx index d6753a3b..c16a8f98 100644 --- a/integration-test/jest/src/hooks.test.jsx +++ b/integration-test/jest/src/hooks.test.jsx @@ -24,7 +24,17 @@ afterEach(resetNextSSRApolloSingletons); * data from the server to the browser. */ test("uses the browser build", () => { - expect(NextSSRApolloClient.name).toBe("ApolloClientBrowserImpl"); + let foundPrototype = false; + let proto = NextSSRApolloClient; + while (proto) { + if (proto.name === "ApolloClientBrowserImpl") { + foundPrototype = true; + break; + } + proto = Object.getPrototypeOf(proto); + } + + expect(foundPrototype).toBe(true); }); /** diff --git a/integration-test/vitest/src/hooks.test.jsx b/integration-test/vitest/src/hooks.test.jsx index d6753a3b..c16a8f98 100644 --- a/integration-test/vitest/src/hooks.test.jsx +++ b/integration-test/vitest/src/hooks.test.jsx @@ -24,7 +24,17 @@ afterEach(resetNextSSRApolloSingletons); * data from the server to the browser. */ test("uses the browser build", () => { - expect(NextSSRApolloClient.name).toBe("ApolloClientBrowserImpl"); + let foundPrototype = false; + let proto = NextSSRApolloClient; + while (proto) { + if (proto.name === "ApolloClientBrowserImpl") { + foundPrototype = true; + break; + } + proto = Object.getPrototypeOf(proto); + } + + expect(foundPrototype).toBe(true); }); /**