Skip to content

Commit

Permalink
🔧 chore: Make perf test print moar
Browse files Browse the repository at this point in the history
  • Loading branch information
masonmark committed Jan 18, 2025
1 parent 66a1fa0 commit 7884273
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions performance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async function runTsc(file: string)
const elapsedMs = end - start;

const stdoutString = new TextDecoder().decode(stdout);
const stderrString = new TextDecoder().decode(stderr);

expect(code, 'tsc exited with a non-zero exit code').toBe(0);
expect(stdoutString, 'tsc produced no output').not.toBe('');
Expand All @@ -35,7 +36,7 @@ async function runTsc(file: string)
expect(match, 'tsc produced a valid check time line').not.toBe(null);
const checkTime = parseFloat(match![1]);

return { code, stdout, stderr, elapsedMs, checkTime };
return { code, stdout: stdoutString, stderr: stderrString, elapsedMs, checkTime };
}

describe('TypeScript type-checking performance of tsc with a large Localization and related types', () =>
Expand All @@ -45,8 +46,11 @@ describe('TypeScript type-checking performance of tsc with a large Localization
const largeFile = await runTsc('performance.fixture.ts');
const simpleFile = await runTsc('escapeHTML.ts');

console.log(`checkTime: ${largeFile.checkTime}ms vs ${simpleFile.checkTime}ms`);

console.log(`checkTime: ${largeFile.checkTime}ms vs ${simpleFile.checkTime}s`);

console.log(largeFile);
console.log(simpleFile);

expect(largeFile.code).toBe(0);
expect(largeFile.stdout).not.toBe('');

Expand Down

0 comments on commit 7884273

Please sign in to comment.