openpetswithchatandmcp/website/analyze-ast-sizes-try.ts
OpenPets Dev 65ac83849e Add 'website/' from commit '966aea480ffe1c340553aa878def30131d2af827'
git-subtree-dir: website
git-subtree-mainline: 8d3849caea
git-subtree-split: 966aea480f
2026-06-17 20:48:39 +00:00

13 lines
622 B
TypeScript
Executable file

import { Project, SyntaxKind } from 'ts-morph';
const project = new Project({ tsConfigFilePath: 'C:/ScriptoriumAI/scriptoriumai-ui/tsconfig.json' });
const sf = project.getSourceFileOrThrow('C:/ScriptoriumAI/scriptoriumai-ui/src/__tests__/Runboard.telemetry-lockstep-parity.test.tsx');
const tests = sf.getDescendantsOfKind(SyntaxKind.CallExpression).filter(c => c.getExpression().getText() === 'it');
tests.sort((a,b) => b.getWidth() - a.getWidth());
for(let i=0; i<4; i++) {
const testCall = tests[i];
if (!testCall) break;
console.log('Test ' + i + ' title: ' + testCall.getArguments()[0].getText());
}