diff --git a/src/lib/utils/pattern-utils.ts b/src/lib/utils/pattern-utils.ts index 23d2e0f6..d1e9e30a 100644 --- a/src/lib/utils/pattern-utils.ts +++ b/src/lib/utils/pattern-utils.ts @@ -1,4 +1,4 @@ -import { Comment } from '@bitsocialhq/bitsocial-react-hooks'; +import type { Comment } from '@bitsocialhq/bitsocial-react-hooks'; import useSubplebbitsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits'; /** diff --git a/src/stores/__tests__/use-catalog-filters-store.test.ts b/src/stores/__tests__/use-catalog-filters-store.test.ts index d4e25b31..4b836e20 100644 --- a/src/stores/__tests__/use-catalog-filters-store.test.ts +++ b/src/stores/__tests__/use-catalog-filters-store.test.ts @@ -7,6 +7,10 @@ const testState = vi.hoisted(() => ({ }), })); +vi.mock('../../lib/utils/pattern-utils', () => ({ + commentMatchesPattern: (comment: unknown, pattern: string) => testState.commentMatchesPatternMock(comment as never, pattern), +})); + type CatalogFiltersStoreModule = typeof import('../use-catalog-filters-store'); type CatalogFiltersStore = Awaited>; @@ -14,10 +18,6 @@ const STORAGE_KEY = 'catalog-filters-storage'; const loadStore = async () => { vi.resetModules(); - vi.doMock('../../lib/utils/pattern-utils', () => ({ - commentMatchesPattern: (comment: unknown, pattern: string) => testState.commentMatchesPatternMock(comment as never, pattern), - })); - const module = (await import('../use-catalog-filters-store')) as CatalogFiltersStoreModule; await Promise.resolve(); return module.default; @@ -48,7 +48,6 @@ describe('useCatalogFiltersStore', () => { afterEach(() => { vi.useRealTimers(); - vi.doUnmock('../../lib/utils/pattern-utils'); consoleWarnSpy.mockRestore(); });