UNPKG

ctrlshiftleft

Version:

AI-powered toolkit for embedding QA and security testing into development workflows

66 lines (65 loc) 2.13 kB
import { EventEmitter } from 'events'; /** * Options for configuring the Watcher */ export interface WatcherOptions { /** Debounce delay in milliseconds */ debounceMs: number; /** File patterns to ignore */ ignorePatterns: string[]; /** Whether to automatically run tests after generation */ runTests?: boolean; /** Whether to generate security and QA checklists */ generateChecklists?: boolean; /** Whether to show diffs between file changes */ showDiffs?: boolean; /** Browser to use for running tests */ browser?: string; /** Whether to run browser in headless mode */ headless?: boolean; /** Number of parallel test workers */ workers?: number; } /** * File watcher for auto-running tests and security analysis * Watches source files for changes and automatically generates tests, * runs those tests, and performs security analysis. */ export declare class Watcher extends EventEmitter { private options; private watcher; private testGenerator; private testRunner; private checklistGenerator; private isProcessing; private fileContents; private securityIssues; /** * Create a new watcher instance * @param options Configuration options */ constructor(options: WatcherOptions); /** * Watch source files and generate tests on changes * @param sourcePath Source path to watch * @param outputDir Output directory for generated tests */ watch(sourcePath: string, outputDir: string): Promise<void>; /** * Stop watching files and clean up resources */ stop(): void; /** * Handle file change events * @param event File event type (add, change, unlink) * @param filePath Path to the changed file * @param outputDir Output directory for generated tests */ private handleFileChange; /** * Check if file is a source file that should trigger test generation * @param filePath Path to file to check * @returns True if the file is a source file that should trigger test generation */ private isSourceFile; }