Skip to content

Commit 07054d9

Browse files
committed
fix: 修复TypeScript编译错误,确保GitHub Actions能正常构建
- 修复src/test/setup.ts中的vi和global类型错误 - 修复src/utils/__tests__/indexedDBStorage.test.ts中的未使用变量警告 - 确保构建过程能够成功完成,GitHub Actions可以正常部署
1 parent 5f96f75 commit 07054d9

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/test/setup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import '@testing-library/jest-dom'
2+
import { vi } from 'vitest'
23

34
// Mock IndexedDB for testing
45
const mockIndexedDB = {
@@ -12,7 +13,7 @@ Object.defineProperty(window, 'indexedDB', {
1213
})
1314

1415
// Mock console methods to reduce noise in tests
15-
global.console = {
16+
;(globalThis as any).console = {
1617
...console,
1718
log: vi.fn(),
1819
debug: vi.fn(),

src/utils/__tests__/indexedDBStorage.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect, beforeEach, vi } from 'vitest'
1+
import { describe, it, expect } from 'vitest'
22

33
// Create a simple test for the saveRules functionality
44
describe('IndexedDBStorageManager - Rule Deletion Fix', () => {
@@ -33,7 +33,7 @@ describe('IndexedDBStorageManager - Rule Deletion Fix', () => {
3333
return result
3434
}
3535

36-
const simulateNewBehavior = (existingRules: any[], newRules: any[]) => {
36+
const simulateNewBehavior = (_existingRules: any[], newRules: any[]) => {
3737
// New behavior: clear all, then add new rules
3838
return [...newRules]
3939
}

0 commit comments

Comments
 (0)