Add type parameters to vi.fn() mocks for oxlint 1.60 vitest rule
oxlint 1.60 enables vitest/require-mock-type-parameters by default, which requires explicit type parameters on all vi.fn() calls. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,7 +46,7 @@ describe('EventStubView', () => {
|
||||
})
|
||||
|
||||
it('copies link to clipboard and shows confirmation', async () => {
|
||||
const writeTextMock = vi.fn().mockResolvedValue(undefined)
|
||||
const writeTextMock = vi.fn<(text: string) => Promise<void>>().mockResolvedValue(undefined)
|
||||
Object.assign(navigator, {
|
||||
clipboard: { writeText: writeTextMock },
|
||||
})
|
||||
@@ -63,7 +63,7 @@ describe('EventStubView', () => {
|
||||
|
||||
it('shows failure message when clipboard is unavailable', async () => {
|
||||
Object.assign(navigator, {
|
||||
clipboard: { writeText: vi.fn().mockRejectedValue(new Error('Not allowed')) },
|
||||
clipboard: { writeText: vi.fn<(text: string) => Promise<void>>().mockRejectedValue(new Error('Not allowed')) },
|
||||
})
|
||||
|
||||
const wrapper = await mountWithToken('fail-test')
|
||||
|
||||
Reference in New Issue
Block a user