13 lines
683 B
TypeScript
Executable file
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');
|
|
}
|
|
|