Skip to content

Commit e5c17e9

Browse files
authored
Merge pull request #138 from satoryu/claude/implement-testing-roadmap-kQJ9N
test: implement Phase 1 - Testing Infrastructure Foundation
2 parents 01cf010 + c1ba4cf commit e5c17e9

14 files changed

Lines changed: 1309 additions & 54 deletions

File tree

.github/workflows/_test.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,16 @@ jobs:
1414
cache: 'npm'
1515

1616
- run: npm install
17-
- run: npm test
17+
18+
- name: TypeScript type checking
19+
run: npm run compile
20+
21+
- name: Run tests with coverage
22+
run: npm run test:coverage
23+
24+
- name: Upload coverage reports to Codecov
25+
uses: codecov/codecov-action@v4
26+
with:
27+
token: ${{ secrets.CODECOV_TOKEN }}
28+
fail_ci_if_error: false
29+
files: ./coverage/lcov.info

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ stats.html
1313
stats-*.json
1414
.wxt
1515
web-ext.config.ts
16+
coverage
1617

1718
# Editor directories and files
1819
.vscode/*

entrypoints/context_menu/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ repository.registerHandler({
2626
repository.registerHandler({
2727
id: 'copy-selection-as-quotation',
2828
title: '__MSG_contextMenuQuotationTitle__',
29+
// @ts-expect-error - 'selection' is a valid context type for Chrome extensions
2930
contexts: ['selection'],
3031
handler: async (info, tab) => {
3132
createLinkForTab(tab)

entrypoints/sidepanel/hooks/useClipboardHistory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export function useClipboardHistory() {
77
useEffect(() => {
88
loadHistory();
99

10-
const handleStorageChange = (changes: { [key: string]: browser.storage.StorageChange }) => {
10+
const handleStorageChange = (changes: Record<string, Browser.storage.StorageChange>) => {
1111
if (changes.clipboardHistory) {
12-
setHistory(changes.clipboardHistory.newValue || []);
12+
setHistory((changes.clipboardHistory.newValue as ClipboardHistoryItem[] | undefined) || []);
1313
}
1414
};
1515

entrypoints/sidepanel/utils/i18n.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ export function getMessage(
66
fallback?: string
77
): string {
88
if (Array.isArray(substitutionsOrFallback)) {
9+
// @ts-expect-error - Dynamic key access is needed for i18n fallback pattern
910
return browser.i18n.getMessage(key, substitutionsOrFallback) || fallback || '';
1011
}
12+
// @ts-expect-error - Dynamic key access is needed for i18n fallback pattern
1113
return browser.i18n.getMessage(key) || substitutionsOrFallback;
1214
}

0 commit comments

Comments
 (0)