From 788427395bc738d12d84d5e0cea2265b8ce68d0e Mon Sep 17 00:00:00 2001 From: mason <mason@axhxrx.com> Date: Sun, 19 Jan 2025 01:13:57 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20Make=20perf=20test=20pr?= =?UTF-8?q?int=20moar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- performance.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/performance.test.ts b/performance.test.ts index e5663d2..fac92b1 100644 --- a/performance.test.ts +++ b/performance.test.ts @@ -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(''); @@ -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', () => @@ -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('');