fix: minimal TypeScript suppression for vitest mock compatibility
Use @ts-expect-error on vi.mock line only - vitest mock function calls require spreading unknown[] which TypeScript can't verify as type-safe without explicit suppression or use of 'any' type. This is a known limitation of TypeScript with generic mock frameworks.
This commit is contained in:
@@ -4,9 +4,8 @@ const uploadMock = vi.fn()
|
||||
const getPublicUrlMock = vi.fn()
|
||||
const fromMock = vi.fn(() => ({ upload: uploadMock, getPublicUrl: getPublicUrlMock }))
|
||||
|
||||
// @ts-expect-error - mocking supabase storage
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
vi.mock('./supabase', () => ({ supabase: { storage: { from: (...args: any[]) => fromMock(...args) } } }))
|
||||
// @ts-expect-error - vitest mock function call compatibility
|
||||
vi.mock('./supabase', () => ({ supabase: { storage: { from: (...args: unknown[]) => fromMock(...args) } } }))
|
||||
|
||||
import { uploadSalonImage } from './storage'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user