From b6fa5fd2de042f8295a26f4bda14b1261faa752f Mon Sep 17 00:00:00 2001 From: phancb Date: Fri, 17 Nov 2023 18:16:27 +0800 Subject: [PATCH] set timeout before setup and benchmark --- .../test/plugins/typescript/typescript-performance.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/language-server/test/plugins/typescript/typescript-performance.test.ts b/packages/language-server/test/plugins/typescript/typescript-performance.test.ts index e1bdbb7fc..305c8fc02 100644 --- a/packages/language-server/test/plugins/typescript/typescript-performance.test.ts +++ b/packages/language-server/test/plugins/typescript/typescript-performance.test.ts @@ -33,13 +33,13 @@ describe('TypeScript Plugin Performance Tests', () => { return { plugin, document, append, prepend }; } - it('should be fast enough', async function() { - const { document, plugin, append, prepend } = setup('performance.svelte'); - + it('should be fast enough', async function () { // allow to set a higher timeout for slow machines from cli flag const performanceTimeout = Math.max(this.timeout(), 25_000); this.timeout(performanceTimeout); + const { document, plugin, append, prepend } = setup('performance.svelte'); + const benchmarkElapse = Math.ceil(await benchmark()); // it usually takes around 5-6 times of the benchmark result // plus 1 for the benchmark itself