cypress-terminal-report
Version:
Better terminal and file output for cypress test logs.
42 lines (41 loc) • 1.56 kB
TypeScript
import type { AllMessages, PluginOptions } from '../installLogsPrinter.types';
import BaseOutputProcessor from './BaseOutputProcessor';
import type { Log } from '../types';
export declare const TYPE_PADDING: number;
export declare function escapeHtml(html: string): string;
/**
* Format an individual Cypress message for HTML logging:
* - Convert cy.log markup syntax to HTML (bold/italic).
* - Color message depending on message type and severity.
* - Trim long messages.
* - Apply proper spacing, newlines, and HTML syntax.
*/
export declare function formatMessage({ type, message, severity }: Log, options: PluginOptions): string;
export default class HtmlOutputProcessor extends BaseOutputProcessor {
protected file: string;
protected options: PluginOptions;
/**
* Style CSS, gets placed within the `<style>` tag of the html document.
*
* @default
body { font-family: monospace; }
p { margin: 0; padding: 0; }
pre { display: inline; margin: 0; }
h2 { margin: 0; font-size: 1.2em; }
*/
protected style: string;
private closingContent;
private beforeClosingContentPos;
constructor(file: string, options: PluginOptions,
/**
* Style CSS, gets placed within the `<style>` tag of the html document.
*
* @default
body { font-family: monospace; }
p { margin: 0; padding: 0; }
pre { display: inline; margin: 0; }
h2 { margin: 0; font-size: 1.2em; }
*/
style?: string);
write(allMessages: AllMessages): void;
}