Skip to content

Commit

Permalink
adjust integration tests to new inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Mar 13, 2024
1 parent c0715a0 commit da19a5f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion integration-test/jest/src/hooks.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

/**
Expand Down
12 changes: 11 additions & 1 deletion integration-test/vitest/src/hooks.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

/**
Expand Down

0 comments on commit da19a5f

Please sign in to comment.