Files
multica/tests/setup/vitest.setup.ts
yushen 26a03d1317 fix: resolve all ESLint warnings (252 -> 0)
- Add explicit return types to functions across main, preload, and renderer
- Replace `any` types with specific types or eslint-disable comments
- Fix unused variables by removing or prefixing with underscore
- Add eslint-disable for react-refresh/only-export-components
- Fix React hooks dependency warnings
- Add test mocks for electron-log/main and @electron-toolkit/utils

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 17:07:05 +08:00

34 lines
604 B
TypeScript

import { vi } from 'vitest'
// Mock electron module globally
vi.mock('electron', () => ({
app: {
getPath: vi.fn().mockReturnValue('/mock/user/data')
}
}))
// Mock electron-log/main
vi.mock('electron-log/main', () => ({
default: {
initialize: vi.fn(),
transports: {
file: { level: false },
console: { level: 'debug' }
},
errorHandler: {
startCatching: vi.fn()
},
info: vi.fn(),
warn: vi.fn(),
error: vi.fn(),
debug: vi.fn()
}
}))
// Mock @electron-toolkit/utils
vi.mock('@electron-toolkit/utils', () => ({
is: {
dev: true
}
}))