@knapsack-pro/core
Version:
Knapsack Pro Core library splits tests across CI nodes and makes sure that tests will run in optimal time on each CI node. This library gives core features like communication with KnapsackPro.com API. This library is a dependency for other projects specif
25 lines (24 loc) • 1.11 kB
TypeScript
import type { AxiosError, AxiosPromise, AxiosRequestConfig } from 'axios';
import { TestFile } from './models/index.js';
export declare const getHeaders: ({ clientName, clientVersion, }: {
clientName: string;
clientVersion: string;
}) => {
'KNAPSACK-PRO-CI-PROVIDER'?: string | undefined;
'KNAPSACK-PRO-CLIENT-NAME': string;
'KNAPSACK-PRO-CLIENT-VERSION': string;
};
export declare class KnapsackProAPI {
private readonly api;
private knapsackProLogger;
constructor(clientName: string, clientVersion: string);
fetchTestsFromQueue(allTestFiles: TestFile[], initializeQueue: boolean, attemptConnectToQueue: boolean): AxiosPromise<any>;
createBuildSubset(recordedTestFiles: TestFile[]): AxiosPromise<any>;
isExpectedErrorStatus(error: AxiosError): boolean;
private setUpApiClient;
private retryCondition;
private isRetriableRequestError;
private retryDelay;
onMaxRetryTimesExceeded: (_error: Error, _retryCount: number) => void;
onRetry: (retryCount: number, _error: AxiosError, requestConfig: AxiosRequestConfig) => Promise<void> | void;
}