openpetswithchatandmcp/website/analyze-ast-sizes.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
683 B
TypeScript
Executable file

import { Project, SyntaxKind, Statement, ExpressionStatement, CallExpression } 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');
console.log('Number of tests: ' + tests.length);
tests.sort((a,b) => b.getWidth() - a.getWidth());
for(let i=0; i<5; i++) {
if(tests[i]) console.log('Test ' + i + ' size: ~' + Math.round(tests[i].getWidth()/1024) + 'KB');
}