19 lines
935 B
TypeScript
Executable file
19 lines
935 B
TypeScript
Executable file
|
|
import { Project, SyntaxKind } from "ts-morph";
|
|
const project = new Project({ tsConfigFilePath: "C:/ScriptoriumAI/scriptoriumai-ui/tsconfig.json" });
|
|
const sourceFile = project.getSourceFileOrThrow("C:/ScriptoriumAI/scriptoriumai-ui/src/__tests__/Runboard.telemetry-lockstep-parity.test.tsx");
|
|
let printed = false;
|
|
sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression).forEach(callExpr => {
|
|
const expr = callExpr.getExpression();
|
|
if (expr.getKind() === SyntaxKind.PropertyAccessExpression && expr.getText().endsWith(".mockResolvedValueOnce")) {
|
|
const arg = callExpr.getArguments()[0];
|
|
if (!printed) {
|
|
console.log("Arg kind:", arg.getKindName(), arg.getText().substring(0, 50));
|
|
if (arg.getKind() === SyntaxKind.AsExpression) {
|
|
console.log("AsExpr inner:", (arg as any).getExpression().getKindName());
|
|
}
|
|
printed = true;
|
|
}
|
|
}
|
|
});
|
|
|