playwright-flake-checker
Version:
A tool to check for flaky Playwright tests by running them multiple times and analyzing results.
38 lines (37 loc) • 1.95 kB
TypeScript
import { ChildProcess } from 'child_process';
/**
* Cleans up event listeners from both the process and child object.
*
* @param proc - The Node.js process object from which to remove listeners
* @param child - An object with removeListener method, typically a child process
* @param handlers - Object containing event handler references
* @param handlers.error - Error event handler to be removed
* @param handlers.exit - Exit/close event handler to be removed
* @param handlers.ctrlC - SIGINT event handler to be removed
* @returns {void}
*/
export declare const cleanup: (proc: NodeJS.Process, child: ChildProcess, handlers: {
error: (_error: Error) => void;
exit: (_code: number | null, _signal: string | null) => void;
ctrlC: () => void;
}) => void;
/**
* Creates a command executor function that runs shell commands as child processes
*
* @returns A function that executes commands and returns their results
* - `command` The command to execute
* - `args` Optional array of command arguments
* - `env` Optional environment variables to add to the process environment
* - `silent` If true, suppresses command output to stdout/stderr
* - `captureOutput` If true, captures and returns command output
*/
export declare const createCommandExecutor: () => (_command: string, _args?: string[], _env?: Record<string, string>, _silent?: boolean, _captureOutput?: boolean) => Promise<CommandResult>;
/**
* Executes commands using the command executor created by `createCommandExecutor`.
* This function likely runs shell commands or similar operations.
*
* @returns The result of the executed command, type determined by the underlying executor
*
* @see `createCommandExecutor` For information about the underlying implementation
*/
export declare const runCommand: (_command: string, _args?: string[], _env?: Record<string, string>, _silent?: boolean, _captureOutput?: boolean) => Promise<CommandResult>;