import { TraceClient } from "@empiricalrun/llm"; import type { TestCaseWithSuitesAsArray } from "@empiricalrun/shared-types/api/test-cases"; import { Node, SourceFile } from "ts-morph"; export declare const getTestModuleAliasFromSourceFile: (sourceFile: SourceFile) => string; /** * function to get the test block and test node for the scenario * @export * @param {string} scenarioName * @param {string} content * @return { testBlock: string; parentDescribe: string; } testBlock - the test block content, testNode - the test function node */ export declare function getTypescriptTestBlock({ scenarioName, suites, content, }: { scenarioName: string; suites?: string[]; content: string; }): { testBlock: string | undefined; testNode: Node | undefined; testAlias: string; }; export declare function hasTestBlock({ testName, suites, filePath, }: { testName: string; suites: string[]; filePath: string; }): boolean; export declare function hasTopLevelDescribeConfigureWithSerialMode(filePath: string): Promise; /** * Function to find the first 'describe' block configured with 'serial: true' * * e.g. * * test.describe("foo", () => { * * test.describe.configure({ mode: "serial" }); * * test.describe("bar", () => { * * test.describe.configure({ mode: "serial" }); * * }) * * }) * * for the above example, * this function will return the first 'describe' block which is named "foo" * * @param {(Node | undefined)} node * @return {(Node | undefined)} */ export declare function findFirstSerialDescribeBlock(node: Node | undefined): Node | undefined; export declare function appendToTestBlock(testBlock: string, content: string): string; export declare function runTypescriptCompiler(repoDir: string): Promise<{ success: boolean; errors: string[]; }>; export declare function validateTypescript(filePath: string): string[]; export declare function stripAndPrependImports(content: string, testName: string): Promise<(string | undefined)[]>; export declare function lintErrors(filePath: string): Promise; export declare function formatCode(filePath: string, trace?: TraceClient): Promise; export declare function addNewImport(contents: string, modules: string[], pkg: string): string; export declare function getFixtureImportPath(filePath: string): string; export declare function getPageVariableNameFromCreateTest(filePath: string): Promise; export declare function replaceCreateTestWithNewCode(filePath: string, contents: string, generatedCode: string): string; export declare const injectCodeSnippetBySuiteChain: ({ testFileContent, codeSnippet, suites, }: { testFileContent: string; codeSnippet: string; suites: string[]; }) => string; export declare const importAllExportsStmtFromFilePaths: (repoDir: string, filePaths: string[], testFilePath: string) => Promise; export declare function addUserContextFixture({ scenarioName, filePath, suites, }: { scenarioName: string; filePath: string; suites: string[]; }): Promise; export declare function appendScopeToCreateTest(filePath: string, scopeVariables: string[]): Promise; export declare function isTestPresent({ specPath, testCase, }: { specPath: string; testCase: TestCaseWithSuitesAsArray; }): boolean; export declare function buildTestNamePrompt({ testName, suites, }: { testName: string; suites: string[]; }): string; export declare function getVariableDeclarationsFromCode(sourceCode: string): string[]; export declare function isSyntaxValid(code: string): boolean; //# sourceMappingURL=index.d.ts.map