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:
@@ -2,11 +2,12 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
||||
import { mount, flushPromises } from '@vue/test-utils'
|
||||
import { createRouter, createMemoryHistory } from 'vue-router'
|
||||
import EventList from '../EventList.vue'
|
||||
import type { api } from '../../api/client'
|
||||
|
||||
vi.mock('../../api/client', () => ({
|
||||
api: {
|
||||
PATCH: vi.fn(),
|
||||
DELETE: vi.fn(),
|
||||
PATCH: vi.fn<typeof api.PATCH>(),
|
||||
DELETE: vi.fn<typeof api.DELETE>(),
|
||||
},
|
||||
}))
|
||||
|
||||
@@ -31,7 +32,7 @@ const mockEvents = [
|
||||
{ eventToken: 'rsvp-1', title: 'Attending Event', dateTime: '2026-03-11T20:00:00', rsvpToken: 'rsvp-token', rsvpName: 'Max' },
|
||||
]
|
||||
|
||||
const removeEventMock = vi.fn()
|
||||
const removeEventMock = vi.fn<(eventToken: string) => void>()
|
||||
|
||||
vi.mock('../../composables/useEventStorage', () => ({
|
||||
isValidStoredEvent: (e: unknown) => {
|
||||
|
||||
Reference in New Issue
Block a user