Skip to content

Commit fabdd0e

Browse files
committed
fix: stabilize catalog filter coverage imports
1 parent 5d77a33 commit fabdd0e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/lib/utils/pattern-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Comment } from '@bitsocialhq/bitsocial-react-hooks';
1+
import type { Comment } from '@bitsocialhq/bitsocial-react-hooks';
22
import useSubplebbitsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits';
33

44
/**

src/stores/__tests__/use-catalog-filters-store.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ const testState = vi.hoisted(() => ({
77
}),
88
}));
99

10+
vi.mock('../../lib/utils/pattern-utils', () => ({
11+
commentMatchesPattern: (comment: unknown, pattern: string) => testState.commentMatchesPatternMock(comment as never, pattern),
12+
}));
13+
1014
type CatalogFiltersStoreModule = typeof import('../use-catalog-filters-store');
1115
type CatalogFiltersStore = Awaited<ReturnType<typeof loadStore>>;
1216

1317
const STORAGE_KEY = 'catalog-filters-storage';
1418

1519
const loadStore = async () => {
1620
vi.resetModules();
17-
vi.doMock('../../lib/utils/pattern-utils', () => ({
18-
commentMatchesPattern: (comment: unknown, pattern: string) => testState.commentMatchesPatternMock(comment as never, pattern),
19-
}));
20-
2121
const module = (await import('../use-catalog-filters-store')) as CatalogFiltersStoreModule;
2222
await Promise.resolve();
2323
return module.default;
@@ -48,7 +48,6 @@ describe('useCatalogFiltersStore', () => {
4848

4949
afterEach(() => {
5050
vi.useRealTimers();
51-
vi.doUnmock('../../lib/utils/pattern-utils');
5251
consoleWarnSpy.mockRestore();
5352
});
5453

0 commit comments

Comments
 (0)