From 449d6a7ef6e7633bc267fa3ec20b02de64a85259 Mon Sep 17 00:00:00 2001 From: gtmnayan Date: Thu, 11 May 2023 21:34:09 +0545 Subject: [PATCH] pls work --- test/custom-elements/index.js | 7 ++++--- test/runtime-playwright/index.js | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/custom-elements/index.js b/test/custom-elements/index.js index f86c3532e3..c1c6d19a19 100644 --- a/test/custom-elements/index.js +++ b/test/custom-elements/index.js @@ -9,8 +9,6 @@ import { loadConfig, loadSvelte } from '../helpers'; const assert = fs.readFileSync(`${__dirname}/assert.js`, 'utf-8'); describe('custom-elements', function () { - this.timeout(10000); - let svelte; /** @type {import('@playwright/test').Browser} */ let browser; @@ -26,6 +24,8 @@ describe('custom-elements', function () { if (browser) await browser.close(); }); + let first_run = true; + fs.readdirSync(`${__dirname}/samples`).forEach((dir) => { if (dir[0] === '.') return; @@ -36,6 +36,7 @@ describe('custom-elements', function () { const warnings = []; (solo ? it.only : skip ? it.skip : it)(dir, async () => { + first_run = false; const config = loadConfig(`${__dirname}/samples/${dir}/_config.js`); const expected_warnings = config.warnings || []; @@ -102,6 +103,6 @@ describe('custom-elements', function () { if (test_result) console.log(test_result); assertWarnings(); page.close(); - }); + }).timeout(first_run ? 20000 : 10000); }); }); diff --git a/test/runtime-playwright/index.js b/test/runtime-playwright/index.js index 804300e84f..b7c758a2a9 100644 --- a/test/runtime-playwright/index.js +++ b/test/runtime-playwright/index.js @@ -48,6 +48,7 @@ describe('runtime (playwright)', function () { (skip ? it.skip : solo ? it.only : it)( `${dir} ${hydrate ? '(with hydration)' : ''}`, async () => { + first_run = false; if (failed.has(dir)) { // this makes debugging easier, by only printing compiled output once throw new Error('skipping test, already failed'); @@ -220,9 +221,10 @@ describe('runtime (playwright)', function () { throw err; } } - ); + ).timeout(first_run ? 20000 : 10000); } + let first_run = true; fs.readdirSync(`${__dirname}/samples`).forEach((dir) => { runTest(dir, false); runTest(dir, true);