UNPKG

deepsource-mcp-server

Version:
193 lines (192 loc) 6.86 kB
/** * Test utilities for DeepSource tests */ import { DeepSourceClient, MetricShortcode, ReportType } from '../../deepsource.js'; import { MetricDirection, MetricKey } from '../../types/metrics.js'; /** * TestableDeepSourceClient extends DeepSourceClient to expose private methods for testing. * This class provides test-only methods to access private static and instance methods * in the DeepSourceClient class. */ export declare class TestableDeepSourceClient extends DeepSourceClient { /** * Test method for handleTestEnvironment private static method */ static testHandleTestEnvironment(params: { projectKey: string; metricShortcode: MetricShortcode; metricKey: MetricKey; }): Promise<{ shortcode: string; metricKey: string; name: string; unit: string; positiveDirection: string; threshold?: number; isTrendingPositive?: boolean; values: Array<{ value: number; valueDisplay: string; threshold?: number; thresholdStatus?: string; commitOid?: string; createdAt?: string; }>; } | null | undefined>; /** * Test method for validateAndGetMetricInfo private instance method */ testValidateAndGetMetricInfo(params: { projectKey: string; metricShortcode: MetricShortcode; metricKey: MetricKey; }): Promise<{ project: import("../../deepsource.js").DeepSourceProject; metric: import("../../deepsource.js").RepositoryMetric; metricItem: import("../../deepsource.js").RepositoryMetricItem; }>; /** * Test method for processRegularMetricHistory private instance method */ testProcessRegularMetricHistory(params: { projectKey: string; metricShortcode: MetricShortcode; metricKey: MetricKey; limit?: number; }): Promise<import("../../deepsource.js").MetricHistoryResponse>; /** * Test method for fetchHistoricalValues private instance method */ testFetchHistoricalValues(params: { projectKey: string; metricShortcode: MetricShortcode; metricKey: MetricKey; limit?: number; }, project: { name: string; repository: { login: string; provider: string; }; }, metricItem: { id: string; key: string; threshold?: number; }): Promise<import("../../deepsource.js").MetricHistoryValue[]>; /** * Test method for createMetricHistoryResponse private static method */ static testCreateMetricHistoryResponse(params: { projectKey: string; metricShortcode: MetricShortcode; metricKey: MetricKey; }, metric: { name: string; shortcode: string; positiveDirection: string; unit: string; }, metricItem: { id: string; key: string; threshold?: number; }, historyValues: Array<{ value: number; valueDisplay: string; threshold?: number; thresholdStatus?: string; commitOid?: string; createdAt?: string; }>): import("../../deepsource.js").MetricHistoryResponse; /** * Test method for calculateTrendDirection private static method */ static testCalculateTrendDirection(values: Array<{ value: number; valueDisplay: string; threshold?: number; thresholdStatus?: string; commitOid?: string; createdAt?: string; }>, positiveDirection: string | MetricDirection): boolean; /** * Test method for isError private static method */ static testIsError(error: unknown): boolean; /** * Test method for isErrorWithMessage private static method */ static testIsErrorWithMessage(error: unknown, substring: string): boolean; /** * Test method for validateProjectRepository private static method */ static testValidateProjectRepository(project: Record<string, unknown>, projectKey: string): void; /** * Test method for extractReportData private static method */ static testExtractReportData(response: Record<string, unknown>, reportType: ReportType): Record<string, unknown> | null; /** * Test method for handling NoneType errors */ static testNoneTypeErrorHandler(): Promise<unknown[]>; /** * Test method for getQualityMetricsWithNoneTypeError */ static testGetQualityMetricsWithNoneTypeError(): Promise<unknown[]>; /** * Test method for processVulnerabilityEdge private static method */ static testProcessVulnerabilityEdge(edge: unknown): import("../../deepsource.js").VulnerabilityOccurrence | null; /** * Test method for isValidVulnerabilityNode private static method */ static testIsValidVulnerabilityNode(node: unknown): boolean; /** * Test method for mapVulnerabilityOccurrence private static method */ static testMapVulnerabilityOccurrence(node: Record<string, unknown>): import("../../deepsource.js").VulnerabilityOccurrence; /** * Test method for iterateVulnerabilities private static method */ static testIterateVulnerabilities(edges: unknown[]): Generator<import("../../deepsource.js").VulnerabilityOccurrence, any, any>; /** * Test method for processVulnerabilityResponse private static method */ static testProcessVulnerabilityResponse(response: unknown): { vulnerabilities: import("../../deepsource.js").VulnerabilityOccurrence[]; pageInfo: { hasNextPage: boolean; hasPreviousPage: boolean; startCursor?: string; endCursor?: string; }; totalCount: number; }; /** * Test method for getReportField private static method */ static testGetReportField(reportType: string): string; /** * Test method for isAxiosErrorWithCriteria private static method */ static testIsAxiosErrorWithCriteria(error: unknown, statusCode?: number, errorCode?: string): boolean; /** * Test method for handleNetworkError private static method */ static testHandleNetworkError(error: unknown): never | false; /** * Test method for handleHttpStatusError private static method */ static testHandleHttpStatusError(error: unknown): never | false; /** * Test method for handleGraphQLError private static method */ static testHandleGraphQLError(error: unknown): never; /** * Test method for handleGraphQLSpecificError private static method */ static testHandleGraphQLSpecificError(error: unknown): never | false; /** * Test method for validateNumber private static method */ static testValidateNumber(value: unknown): number | null; }