/** * runtime.ts * * Provides file system utilities used during the test-saving phase: * finding (or creating) the tests directory and writing generated spec files. * * The Runtime class abstracts away the "where should this file go?" question. * It searches the target project for common test directory names and falls back * to creating a "tests/" folder if none is found. It also handles the slug-to- * filename conversion so all saved specs follow a consistent naming pattern. * * Role in the overall flow: * save_test MCP tool → Runtime.resolveTestsDir() → Runtime.saveTestFile() */ import { FrameworkConfig } from '../types'; /** * Handles filesystem operations needed when saving generated test files to * the user's project. */ export declare class Runtime { private config; /** * @param config - Framework configuration (currently unused directly, available * for future extensions that need config values at save time). */ constructor(config: FrameworkConfig); /** * Find the directory where test spec files should be saved. * * Checks common test directory names in order: tests, e2e, test, spec. * If none exist, creates "tests/" and returns that path. * * @param cwd - The root of the target project to search within. * @returns Absolute path to the resolved tests directory. */ resolveTestsDir(cwd: string): Promise; /** * Write a generated test spec to disk as a .spec.ts file. * * The test name is slugified (lowercased, spaces to hyphens, special chars removed) * to form a safe filename. * * @param testsDir - Directory where the file should be written. * @param name - Human-readable test name used to derive the filename. * @param code - TypeScript source code to write into the file. * @returns Absolute path to the file that was written. */ saveTestFile(testsDir: string, name: string, code: string): Promise; } //# sourceMappingURL=runtime.d.ts.map