fix: update vitest configuration and add setup file for renderer tests

- Updated vitest.config.ts to handle optional chaining for plugins and alias.
- Added setup.ts for mocking electron-log in renderer tests.
- Adjusted test include and exclude patterns to refine test coverage.
This commit is contained in:
kangfenmao
2025-05-11 23:39:03 +08:00
parent f549f39bb8
commit abe441d694
2 changed files with 26 additions and 4 deletions
+20
View File
@@ -0,0 +1,20 @@
import { vi } from 'vitest'
vi.mock('electron-log/renderer', () => {
return {
default: {
info: console.log,
error: console.error,
warn: console.warn,
debug: console.debug,
verbose: console.log,
silly: console.log,
log: console.log,
transports: {
console: {
level: 'info'
}
}
}
}
})