@11joselu/cypress-to-playwright
Version:
Automatic migration from cypress to playwright
14 lines • 687 B
JavaScript
import ts from 'typescript';
import { transform } from './core/converters/transform.js';
export function converter(code, customCommandsTracker) {
if (code.trim() === '')
return code;
const sourceFile = ts.createSourceFile('migration.ts', code, ts.ScriptTarget.Latest, true);
const printer = ts.createPrinter({
newLine: ts.NewLineKind.LineFeed,
});
const transformationResult = ts.transform(sourceFile, [transform(sourceFile, customCommandsTracker)]);
const transformedSourceFile = transformationResult.transformed[0];
return printer.printNode(ts.EmitHint.Unspecified, transformedSourceFile, sourceFile);
}
//# sourceMappingURL=converter.js.map