lint fixes
This commit is contained in:
parent
1f190b1068
commit
c1d04723e1
17 changed files with 34 additions and 27 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* without requiring an actual QuestDB instance.
|
||||
*/
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, mock, spyOn } from 'bun:test';
|
||||
import { afterEach, beforeEach, describe, expect, it, mock } from 'bun:test';
|
||||
import {
|
||||
createQuestDBClient,
|
||||
QuestDBClient,
|
||||
|
|
@ -33,7 +33,7 @@ describe('QuestDB Client Integration', () => {
|
|||
if (client && client.connected) {
|
||||
try {
|
||||
await client.disconnect();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Ignore cleanup errors in tests
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Provides utilities and mocks for testing database operations.
|
||||
*/
|
||||
|
||||
import { beforeAll, beforeEach, mock, spyOn } from 'bun:test';
|
||||
import { beforeAll, beforeEach, mock } from 'bun:test';
|
||||
import { newDb } from 'pg-mem';
|
||||
|
||||
// Mock PostgreSQL database for unit tests
|
||||
|
|
@ -124,7 +124,7 @@ beforeEach(() => {
|
|||
pgMem.public.none('DROP TABLE IF EXISTS indicators CASCADE');
|
||||
pgMem.public.none('DROP TABLE IF EXISTS performance CASCADE');
|
||||
pgMem.public.none('DROP TABLE IF EXISTS risk_metrics CASCADE');
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Tables might not exist, ignore errors
|
||||
}
|
||||
} // Reset fetch mock
|
||||
|
|
@ -248,7 +248,7 @@ export const questdbTestHelpers = {
|
|||
*/
|
||||
validateQuestDBQuery: (query: string): boolean => {
|
||||
// Basic validation for QuestDB-specific syntax
|
||||
const questdbKeywords = ['SAMPLE BY', 'LATEST BY', 'ASOF JOIN', 'SPLICE JOIN', 'LT JOIN'];
|
||||
const _questdbKeywords = ['SAMPLE BY', 'LATEST BY', 'ASOF JOIN', 'SPLICE JOIN', 'LT JOIN'];
|
||||
|
||||
// Check for valid SQL structure
|
||||
const hasSelect = /SELECT\s+/i.test(query);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ describe('Batch Processor', () => {
|
|||
'generic': async (payload) => {
|
||||
return { processed: true, data: payload };
|
||||
},
|
||||
'process-batch-items': async (batchData) => {
|
||||
'process-batch-items': async (_batchData) => {
|
||||
// This is called by the batch processor internally
|
||||
return { batchProcessed: true };
|
||||
},
|
||||
|
|
@ -87,7 +87,7 @@ describe('Batch Processor', () => {
|
|||
await queue.getBullQueue().clean(0, 1000, 'active');
|
||||
await queue.getBullQueue().clean(0, 1000, 'waiting');
|
||||
await queue.getBullQueue().clean(0, 1000, 'delayed');
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Ignore cleanup errors
|
||||
}
|
||||
await queue.close();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, test, expect, beforeEach, afterEach } from 'bun:test';
|
||||
import { Queue, Worker, Job } from 'bullmq';
|
||||
import { Queue, Worker } from 'bullmq';
|
||||
import { DeadLetterQueueHandler } from '../src/dlq-handler';
|
||||
import { getRedisConnection } from '../src/utils';
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ describe('DeadLetterQueueHandler', () => {
|
|||
}
|
||||
await dlqHandler.shutdown();
|
||||
await mainQueue.close();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Ignore cleanup errors
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, 50));
|
||||
|
|
@ -70,7 +70,7 @@ describe('DeadLetterQueueHandler', () => {
|
|||
});
|
||||
|
||||
// Add job with limited attempts
|
||||
const job = await mainQueue.add('failing-job', { test: true }, {
|
||||
const _job = await mainQueue.add('failing-job', { test: true }, {
|
||||
attempts: 3,
|
||||
backoff: { type: 'fixed', delay: 50 },
|
||||
});
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ describe('QueueManager', () => {
|
|||
let processedCount = 0;
|
||||
|
||||
handlerRegistry.register('bulk-handler', {
|
||||
process: async payload => {
|
||||
process: async _payload => {
|
||||
processedCount++;
|
||||
return { processed: true };
|
||||
},
|
||||
|
|
@ -237,7 +237,7 @@ describe('QueueManager', () => {
|
|||
handlerRegistry.registerWithSchedule({
|
||||
name: 'scheduled-handler',
|
||||
operations: {
|
||||
'scheduled-task': async payload => {
|
||||
'scheduled-task': async _payload => {
|
||||
executionCount++;
|
||||
return { executed: true, timestamp: Date.now() };
|
||||
},
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ describe('QueueMetricsCollector', () => {
|
|||
}
|
||||
await queueEvents.close();
|
||||
await queue.close();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Ignore cleanup errors
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, 50));
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ describe('QueueManager Simple Tests', () => {
|
|||
if (queueManager) {
|
||||
try {
|
||||
await queueManager.shutdown();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Ignore errors during cleanup
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ describe('QueueRateLimiter', () => {
|
|||
if (keys.length > 0) {
|
||||
await redisClient.del(...keys);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Ignore cleanup errors
|
||||
}
|
||||
rateLimiter = new QueueRateLimiter(redisClient);
|
||||
|
|
@ -46,7 +46,7 @@ describe('QueueRateLimiter', () => {
|
|||
if (redisClient) {
|
||||
try {
|
||||
await redisClient.quit();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Ignore cleanup errors
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -337,10 +337,11 @@ export function calculateRollingMetrics(
|
|||
case 'volatility':
|
||||
rollingMetrics.push(calculateVolatility(window));
|
||||
break;
|
||||
case 'return':
|
||||
case 'return': {
|
||||
const avgReturn = window.reduce((sum, ret) => sum + ret, 0) / window.length;
|
||||
rollingMetrics.push(avgReturn);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
export function createProxyUrl(proxy: any): string {
|
||||
export function createProxyUrl(proxy: {
|
||||
protocol: string;
|
||||
host: string;
|
||||
port: number;
|
||||
username?: string;
|
||||
password?: string;
|
||||
}): string {
|
||||
const { protocol, host, port, username, password } = proxy;
|
||||
if (username && password) {
|
||||
return `${protocol}://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${host}:${port}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue