diff --git a/app/soapbox/jest/test-setup.ts b/app/soapbox/jest/test-setup.ts index cf24ba3f1b..0052388b05 100644 --- a/app/soapbox/jest/test-setup.ts +++ b/app/soapbox/jest/test-setup.ts @@ -2,14 +2,9 @@ import { __clear as clearApiMocks } from '../__mocks__/api'; -import { queryClient } from './test-helpers'; - // API mocking jest.mock('soapbox/api'); -afterEach(() => { - clearApiMocks(); - queryClient.clear(); -}); +afterEach(() => clearApiMocks()); // Mock IndexedDB // https://dev.to/andyhaskell/testing-your-indexeddb-code-with-jest-2o17 diff --git a/app/soapbox/queries/__tests__/trends.test.ts b/app/soapbox/queries/__tests__/trends.test.ts index 07856cedf2..784f928cb0 100644 --- a/app/soapbox/queries/__tests__/trends.test.ts +++ b/app/soapbox/queries/__tests__/trends.test.ts @@ -1,9 +1,13 @@ import { __stub } from 'soapbox/api'; -import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; +import { queryClient, renderHook, waitFor } from 'soapbox/jest/test-helpers'; import useTrends from '../trends'; describe('useTrends', () => { + beforeEach(() => { + queryClient.clear(); + }); + describe('with a successful query', () => { beforeEach(() => { __stub((mock) => {