playwright-sniff
Version:
Monitoring library for Playwright that measures action times, catches showstoppers and generates reports
38 lines (37 loc) • 1.1 kB
TypeScript
import { LogLevel } from './types';
/**
* Current version of the library
*/
export declare const VERSION = "1.0.0";
/**
* Clean an error message by removing ANSI codes and truncating
*/
export declare function cleanErrorMessage(raw: unknown): string;
/**
* Calculate the average of an array of numbers
*/
export declare function calculateAverage(values: number[]): string | null;
/**
* Calculate percentile value from an array of numbers
*/
export declare function calculatePercentile(values: number[], percentile: number): number;
/**
* Format a duration in milliseconds to a readable string
*/
export declare function formatDuration(ms: number): string;
/**
* Format a date to a readable string
*/
export declare function formatDate(date: Date): string;
/**
* Create a directory if it doesn't exist
*/
export declare function createDirectory(dirPath: string): void;
/**
* Default logger function
*/
export declare function defaultLogger(message: string, level: LogLevel): void;
/**
* Generate a timestamp string for filenames
*/
export declare function generateTimestamp(): string;