Skip to content

Commit 7be21d2

Browse files
committed
fix(core): remove deprecated uuid mock helpers that use vi.doMock
1 parent 029d4d5 commit 7be21d2

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

packages/testing/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export {
7676
mockDrizzleOrm,
7777
mockHybridAuth,
7878
mockKnowledgeSchemas,
79-
mockUuid,
8079
requestUtilsMock,
8180
setupCommonApiMocks,
8281
setupGlobalFetchMock,

packages/testing/src/mocks/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,3 @@ export {
8282
export { clearStorageMocks, createMockStorage, setupGlobalStorageMocks } from './storage.mock'
8383
// Telemetry mocks
8484
export { telemetryMock } from './telemetry.mock'
85-
// UUID mocks
86-
export { mockGenerateId, mockUuid } from './uuid.mock'
Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11
/**
2-
* UUID mock utilities for testing.
2+
* UUID mock utilities — intentionally empty.
33
*
4-
* @deprecated Prefer `vi.hoisted()` + `vi.mock('@/lib/core/utils/uuid', ...)` directly
5-
* in test files. These helpers use `vi.doMock` which violates project testing rules.
4+
* All test files should mock `@/lib/core/utils/uuid` directly using
5+
* `vi.hoisted()` + `vi.mock()` per project testing rules.
66
*/
7-
import { vi } from 'vitest'
8-
9-
/**
10-
* @deprecated Use `vi.hoisted()` + `vi.mock('@/lib/core/utils/uuid', ...)` instead.
11-
*/
12-
export function mockGenerateId(mockValue = 'test-uuid') {
13-
vi.doMock('@/lib/core/utils/uuid', () => ({
14-
generateId: vi.fn().mockReturnValue(mockValue),
15-
generateShortId: vi.fn().mockImplementation((size = 21) => mockValue.slice(0, size)),
16-
isValidUuid: vi
17-
.fn()
18-
.mockImplementation((v: string) =>
19-
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(v)
20-
),
21-
}))
22-
}
23-
24-
/** @deprecated Use `mockGenerateId` instead. */
25-
export const mockUuid = mockGenerateId

0 commit comments

Comments
 (0)