pull/8577/head
gtmnayan 3 years ago
parent 25aab43b57
commit 449d6a7ef6

@ -9,8 +9,6 @@ import { loadConfig, loadSvelte } from '../helpers';
const assert = fs.readFileSync(`${__dirname}/assert.js`, 'utf-8'); const assert = fs.readFileSync(`${__dirname}/assert.js`, 'utf-8');
describe('custom-elements', function () { describe('custom-elements', function () {
this.timeout(10000);
let svelte; let svelte;
/** @type {import('@playwright/test').Browser} */ /** @type {import('@playwright/test').Browser} */
let browser; let browser;
@ -26,6 +24,8 @@ describe('custom-elements', function () {
if (browser) await browser.close(); if (browser) await browser.close();
}); });
let first_run = true;
fs.readdirSync(`${__dirname}/samples`).forEach((dir) => { fs.readdirSync(`${__dirname}/samples`).forEach((dir) => {
if (dir[0] === '.') return; if (dir[0] === '.') return;
@ -36,6 +36,7 @@ describe('custom-elements', function () {
const warnings = []; const warnings = [];
(solo ? it.only : skip ? it.skip : it)(dir, async () => { (solo ? it.only : skip ? it.skip : it)(dir, async () => {
first_run = false;
const config = loadConfig(`${__dirname}/samples/${dir}/_config.js`); const config = loadConfig(`${__dirname}/samples/${dir}/_config.js`);
const expected_warnings = config.warnings || []; const expected_warnings = config.warnings || [];
@ -102,6 +103,6 @@ describe('custom-elements', function () {
if (test_result) console.log(test_result); if (test_result) console.log(test_result);
assertWarnings(); assertWarnings();
page.close(); page.close();
}); }).timeout(first_run ? 20000 : 10000);
}); });
}); });

@ -48,6 +48,7 @@ describe('runtime (playwright)', function () {
(skip ? it.skip : solo ? it.only : it)( (skip ? it.skip : solo ? it.only : it)(
`${dir} ${hydrate ? '(with hydration)' : ''}`, `${dir} ${hydrate ? '(with hydration)' : ''}`,
async () => { async () => {
first_run = false;
if (failed.has(dir)) { if (failed.has(dir)) {
// this makes debugging easier, by only printing compiled output once // this makes debugging easier, by only printing compiled output once
throw new Error('skipping test, already failed'); throw new Error('skipping test, already failed');
@ -220,9 +221,10 @@ describe('runtime (playwright)', function () {
throw err; throw err;
} }
} }
); ).timeout(first_run ? 20000 : 10000);
} }
let first_run = true;
fs.readdirSync(`${__dirname}/samples`).forEach((dir) => { fs.readdirSync(`${__dirname}/samples`).forEach((dir) => {
runTest(dir, false); runTest(dir, false);
runTest(dir, true); runTest(dir, true);

Loading…
Cancel
Save