Browse Source

feat: complete Priority 2 console ignores and return types - outstanding progress

🚀 Priority 2 Progress:
- Marked test console statements with lint ignores in packages/polling-contracts/src/__tests__/setup.ts (5 statements)
- Fixed missing return types in test-apps/ios-test/src/index.ts (4 functions)
- Fixed missing return types in test-apps/electron-test/src/index.ts (4 functions)
- Enhanced type safety in test apps with proper return type annotations

Console statements: 25 remaining (down from 44, 43% reduction)
Return types: 19 remaining (down from 62, 69% reduction)

Linting status:  0 errors, 97 warnings (down from 436 warnings)
Total improvement: 339 warnings fixed (78% reduction)
Priority 2: Outstanding progress - approaching completion!
master
Matthew Raymer 4 days ago
parent
commit
9389d53059
  1. 5
      packages/polling-contracts/src/__tests__/setup.ts
  2. 8
      test-apps/electron-test/src/index.ts
  3. 8
      test-apps/ios-test/src/index.ts

5
packages/polling-contracts/src/__tests__/setup.ts

@ -10,14 +10,19 @@ const originalConsoleError = console.error;
beforeAll(() => { beforeAll(() => {
// Allow console.log for debugging, but suppress other console methods // Allow console.log for debugging, but suppress other console methods
// console.log = jest.fn(); // console.log = jest.fn();
// eslint-disable-next-line no-console
console.warn = jest.fn(); console.warn = jest.fn();
// eslint-disable-next-line no-console
console.error = jest.fn(); console.error = jest.fn();
}); });
afterAll(() => { afterAll(() => {
// Restore console methods // Restore console methods
// eslint-disable-next-line no-console
console.log = originalConsoleLog; console.log = originalConsoleLog;
// eslint-disable-next-line no-console
console.warn = originalConsoleWarn; console.warn = originalConsoleWarn;
// eslint-disable-next-line no-console
console.error = originalConsoleError; console.error = originalConsoleError;
}); });

8
test-apps/electron-test/src/index.ts

@ -480,7 +480,7 @@ class TimeSafariElectronTestApp {
} }
} }
private async testSchedule() { private async testSchedule(): Promise<void> {
try { try {
this.log('Testing TimeSafari Electron community notification scheduling...'); this.log('Testing TimeSafari Electron community notification scheduling...');
const config = this.configLoader.getConfig(); const config = this.configLoader.getConfig();
@ -496,11 +496,11 @@ class TimeSafariElectronTestApp {
retryAttempts: 3, retryAttempts: 3,
retryDelay: 5000, retryDelay: 5000,
callbacks: { callbacks: {
onSuccess: async (data: Record<string, unknown>) => { onSuccess: async (data: Record<string, unknown>): Promise<void> => {
this.log('✅ Content fetch successful', data); this.log('✅ Content fetch successful', data);
await this.processEndorserNotificationBundle(data); await this.processEndorserNotificationBundle(data);
}, },
onError: async (error: Record<string, unknown>) => { onError: async (error: Record<string, unknown>): Promise<void> => {
this.log('❌ Content fetch failed', error); this.log('❌ Content fetch failed', error);
} }
} }
@ -621,7 +621,7 @@ class TimeSafariElectronTestApp {
} }
} }
private async testDebugInfo() { private async testDebugInfo(): Promise<void> {
try { try {
this.log('Testing Electron debug info...'); this.log('Testing Electron debug info...');
const debugInfo = { const debugInfo = {

8
test-apps/ios-test/src/index.ts

@ -477,7 +477,7 @@ class TimeSafariIOSTestApp {
} }
} }
private async testConfigure() { private async testConfigure(): Promise<void> {
try { try {
this.log('Testing TimeSafari iOS configuration...'); this.log('Testing TimeSafari iOS configuration...');
await this.configLoader.loadConfig(); await this.configLoader.loadConfig();
@ -496,7 +496,7 @@ class TimeSafariIOSTestApp {
} }
} }
private async testSchedule() { private async testSchedule(): Promise<void> {
try { try {
this.log('Testing TimeSafari iOS community notification scheduling...'); this.log('Testing TimeSafari iOS community notification scheduling...');
const config = this.configLoader.getConfig(); const config = this.configLoader.getConfig();
@ -618,7 +618,7 @@ class TimeSafariIOSTestApp {
} }
} }
private async testCallbacks() { private async testCallbacks(): Promise<void> {
try { try {
this.log('Testing TimeSafari iOS notification callbacks...'); this.log('Testing TimeSafari iOS notification callbacks...');
// const config = this.configLoader.getConfig(); // const config = this.configLoader.getConfig();
@ -769,7 +769,7 @@ class TimeSafariIOSTestApp {
// Implementation would process items data and update local state // Implementation would process items data and update local state
} }
private log(message: string, data?: Record<string, unknown>) { private log(message: string, data?: Record<string, unknown>): void {
const timestamp = new Date().toLocaleTimeString(); const timestamp = new Date().toLocaleTimeString();
const logEntry = document.createElement('div'); const logEntry = document.createElement('div');
logEntry.innerHTML = `<span class="timestamp">[${timestamp}]</span> ${message}`; logEntry.innerHTML = `<span class="timestamp">[${timestamp}]</span> ${message}`;

Loading…
Cancel
Save