Skip to content

Commit

Permalink
chore(deps): update dependency jest to v29.5.0 (#10647)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency jest to v29.5.0

* chore: remove restoreAllMocks calls

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: alessia <alessia@apollographql.com>
  • Loading branch information
renovate[bot] and alessbell authored Mar 15, 2023
1 parent e1c48c0 commit 67df534
Show file tree
Hide file tree
Showing 9 changed files with 861 additions and 843 deletions.
1,669 changes: 854 additions & 815 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"@types/fetch-mock": "7.3.5",
"@types/glob": "8.1.0",
"@types/hoist-non-react-statics": "3.3.1",
"@types/jest": "29.2.6",
"@types/jest": "29.4.0",
"@types/lodash": "4.14.191",
"@types/node": "18.15.1",
"@types/node-fetch": "2.6.2",
Expand All @@ -131,8 +131,8 @@
"glob": "8.1.0",
"graphql": "16.6.0",
"graphql-ws": "5.12.0",
"jest": "29.3.1",
"jest-environment-jsdom": "29.3.1",
"jest": "29.5.0",
"jest-environment-jsdom": "29.5.0",
"jest-junit": "15.0.0",
"lodash": "4.17.21",
"patch-package": "6.5.1",
Expand Down
3 changes: 0 additions & 3 deletions src/cache/inmemory/__tests__/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ import { TypePolicies } from '../policies';
disableFragmentWarnings();

describe('Cache', () => {
afterAll(() => {
jest.restoreAllMocks();
});
function itWithInitialData(
message: string,
initialDataForCaches: ({ [key: string]: any })[],
Expand Down
3 changes: 0 additions & 3 deletions src/react/hooks/__tests__/useApolloClient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import { InMemoryCache } from '../../../cache';
import { useApolloClient } from '../useApolloClient';

describe('useApolloClient Hook', () => {
beforeEach(() => {
jest.restoreAllMocks();
});
afterEach(() => {
resetApolloContext();
});
Expand Down
3 changes: 0 additions & 3 deletions src/react/hooks/__tests__/useFragment.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import {
import { useQuery } from "../useQuery";

describe("useFragment", () => {
beforeEach(() => {
jest.restoreAllMocks();
});
it("is importable and callable", () => {
expect(typeof useFragment).toBe("function");
});
Expand Down
3 changes: 0 additions & 3 deletions src/react/hooks/__tests__/useLazyQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import { QueryResult } from '../../types/types';
const IS_REACT_18 = React.version.startsWith("18");

describe('useLazyQuery Hook', () => {
beforeEach(() => {
jest.restoreAllMocks();
});
afterEach(() => {
resetApolloContext();
});
Expand Down
3 changes: 0 additions & 3 deletions src/react/hooks/__tests__/useMutation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ import { BatchHttpLink } from '../../../link/batch-http';
import { FetchResult } from '../../../link/core';

describe('useMutation Hook', () => {
beforeEach(() => {
jest.restoreAllMocks();
});
afterEach(() => {
resetApolloContext();
});
Expand Down
11 changes: 4 additions & 7 deletions src/react/hooks/__tests__/useQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ import { useQuery } from '../useQuery';
import { useMutation } from '../useMutation';

describe('useQuery Hook', () => {
beforeEach(() => {
jest.restoreAllMocks();
});
afterEach(() => {
resetApolloContext();
});
Expand Down Expand Up @@ -1758,14 +1755,14 @@ describe('useQuery Hook', () => {
expect(result.current.data).toEqual({ hello: "world 1" });
}, { interval: 1 });
expect(result.current.loading).toBe(false);


await waitFor(() => {
expect(result.current.data).toEqual({ hello: "world 2" });
}, { interval: 1 });
expect(result.current.loading).toBe(false);


result.current.stopPolling();

await expect(waitFor(() => {
Expand Down Expand Up @@ -6985,7 +6982,7 @@ describe('useQuery Hook', () => {
expect(requestSpy).toHaveBeenCalledTimes(shouldFetchOnFirstRender ? 1 : 0);

// We need to wait a moment before the rerender for everything to settle down.
// This part is unfortunately bound to be flaky - but in some cases there is
// This part is unfortunately bound to be flaky - but in some cases there is
// just nothing to "wait for", except "a moment".
await act(() => new Promise((resolve) => setTimeout(resolve, 10)));

Expand Down
3 changes: 0 additions & 3 deletions src/react/hooks/__tests__/useSubscription.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import { MockSubscriptionLink } from '../../../testing';
import { useSubscription } from '../useSubscription';

describe('useSubscription Hook', () => {
beforeEach(() => {
jest.restoreAllMocks();
});
afterEach(() => {
resetApolloContext();
});
Expand Down

0 comments on commit 67df534

Please sign in to comment.