Skip to content

Commit

Permalink
fix timing problems in tests introduced by latest React canary
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Dec 18, 2024
1 parent 3868f31 commit a6427ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/react/hooks/__tests__/useSubscription.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { PROTOCOL_ERRORS_SYMBOL } from "../../../errors";
import { InMemoryCache as Cache } from "../../../cache";
import { ApolloProvider } from "../../context";
import { MockSubscriptionLink } from "../../../testing";
import { MockSubscriptionLink, wait } from "../../../testing";
import { useSubscription } from "../useSubscription";
import { spyOnConsole } from "../../../testing/internal";
import { SubscriptionHookOptions } from "../../types/types";
Expand Down Expand Up @@ -1961,6 +1961,7 @@ describe("ignoreResults", () => {
}
);
if (!IS_REACT_17) {
await wait(0);
expect(subscriptionCreated).toHaveBeenCalledTimes(1);
}

Expand Down Expand Up @@ -2034,6 +2035,7 @@ describe("ignoreResults", () => {
}
);
if (!IS_REACT_17) {
await wait(0);
expect(subscriptionCreated).toHaveBeenCalledTimes(1);
}

Expand Down

0 comments on commit a6427ff

Please sign in to comment.