UNPKG

@jawis/jatec

Version:
101 lines (100 loc) 2.95 kB
import { CapturedValue } from "@jawis/jab"; import { UserTestLogs, TestResult, TestStatus, ZippedTestLog, ErrorLog, TestCurLogs, TestExpLogs } from "./internal"; export declare const testLogOrder: string[]; export declare const testLogStatus: { [_: string]: number; }; /** * */ export declare const errorToTestResult: (error: unknown, extraInfo?: Array<unknown>, extraErrorMsg?: string) => TestResult; /** * - Extra error message is shown first. */ export declare const errorToTestLog: (error: unknown, extraInfo?: Array<unknown>, extraErrorMsg?: string) => TestCurLogs; /** * - testReturn must be cloned, already. */ export declare const errMsgAndReturnToTestLog: (msg: string, testReturn?: CapturedValue) => TestCurLogs; /** * for the return result of the test case. * * - testReturn must be already cloned. * - prefix can be used to make it a rogue log. */ export declare const addReturnToTestLogs: (logs: TestCurLogs, testReturn?: CapturedValue) => TestCurLogs; /** * */ export declare const addErrMsgToTestLog: (testLog: TestCurLogs, msg: string, info?: Array<unknown>) => TestCurLogs; /** * */ export declare const testLogsEqual: (testLog: ZippedTestLog) => boolean; /** * */ export declare const testErrorLogsEqual: (testLog: ErrorLog) => boolean; /** * */ export declare const getTestStatus: (testLogs: ZippedTestLog[]) => TestStatus; /** * */ export declare const zipTestLogs: (exp: TestExpLogs, cur: TestCurLogs) => ZippedTestLog[]; /** * */ export declare const zipObjects: <T, U>(exp: { [_: string]: T[] | undefined; }, cur: { [_: string]: U[] | undefined; }) => { type: "user"; name: string; exp: T[]; cur: U[]; }[]; /** * - doesn't sort test logs. The client must do that itself. */ export declare const getTestData: (exp: TestExpLogs, cur: TestCurLogs) => { testLogs: ZippedTestLog[]; status: TestStatus; }; /** * */ export declare const getJatesTestReport: (id: string, exp: TestExpLogs, result: TestResult) => { id: string; status: TestStatus; zippedTestLogs: ZippedTestLog[]; result: TestResult; }; /** * */ export declare const getClientTestReport: (id: string, exp: TestExpLogs, cur: TestCurLogs) => { id: string; testLogs: ZippedTestLog[]; status: TestStatus; }; /** * compat for converting from old test log format. */ export declare const flatToTestExpLogs_compat: (logs: UserTestLogs, isExp?: boolean) => TestExpLogs; /** * note * - very cumbersome. * - actually no need to handle chk log, because Jarun never sends that. */ export declare const mergeTestLogsAndRogue: (curZipped: ZippedTestLog[], tmp: TestCurLogs) => ZippedTestLog[]; /** * */ export declare const mergeTestLogsAndRogue_map_testlog: (flatRogue: UserTestLogs, elm: ZippedTestLog, logName: string) => ZippedTestLog; /** * */ export declare const mergeTestLogsAndRogue_helper_by_ref: (flatRogue: UserTestLogs, output: ZippedTestLog[], prefix?: string) => void;