UNPKG

@assurka/jest

Version:

Assurka Jest Plugin

72 lines 2.54 kB
import { AggregatedResult, Context, Reporter, ReporterOnStartOptions, Test, TestResult } from '@jest/reporters'; import { AssertionResult } from '@jest/types/build/TestResult'; export interface AssurkaConfig { projectId: string; secret: string; token: string; testSpecs: { [key: string]: any; }; testRun: any; testPlanId: any; testPlan: any; testPlanParams: any; host: string; port: number; } export default class AssurkaCustomReporter implements Reporter { private config; private assurka; private _options; private _globalConfig; private alive; /** *Creates an instance of AssurkaCustomReporter. * @param {*} globalConfig * @param {*} options * @memberof AssurkaCustomReporter */ constructor(globalConfig: any, options: any); /** * Call for tests starting * @param {AggregatedResult} test - jest results * @param {ReporterOnStartOptions} options - jest invoked options */ onRunStart: (test: AggregatedResult, options: ReporterOnStartOptions) => Promise<void>; /** * Called at the start of a test spec * @param {Test} test - jest Test object */ onTestStart: (test: Test) => Promise<void>; /** * Called on a test result * @param {Test} test - jest Test object * @param {AssertionResult} testCaseResult - jest results */ onTestCaseResult: (test: Test, testCaseResult: AssertionResult) => Promise<void>; /** * Called when all is complete * @param {Set<Context>} contexts - jest context * @param {AggregatedResult} results - jest summarized results */ onRunComplete: (contexts: Set<Context>, results: AggregatedResult) => Promise<void>; /** * Called on a test spec completion * @param {Test} test - jest Test object * @param {TestResult} testResult - jest results * @param {AggregatedResult} aggregatedResult - jest summarized results */ onTestResult: (test: Test, testResult: TestResult, aggregatedResult: AggregatedResult) => Promise<void>; getLastError: () => Error | undefined; getSpecPath: (test: Test) => string; /** *Sends results to the Assurka API * @param {string} url - the url * @param {string} method - the api method * @param {*} body - the api body * @memberof AssurkaCustomReporter */ api: (url: string, method: string, body?: any) => Promise<any>; getGitCommit: (path: string) => Promise<unknown>; } //# sourceMappingURL=index.d.ts.map