rename folder

pull/8577/head
gtmnayan 3 years ago
parent 17e6d65db4
commit 5c2a206810

@ -324,7 +324,7 @@ export function mkdirp(dir) {
}
}
export function prettyPrintPuppeteerAssertionError(message) {
export function prettyPrintBrowserAssertionError(message) {
const match = /Error: Expected "(.+)" to equal "(.+)"/.exec(message);
if (match) {

@ -44,7 +44,7 @@ function normalizeHtml(window, html) {
.replace(/>[\s\r\n]+</g, '><')
.trim();
cleanStyle(node);
normalizeStyles(node);
return node.innerHTML.replace(/<\/?noscript\/?>/g, '');
} catch (err) {
@ -52,14 +52,14 @@ function normalizeHtml(window, html) {
}
}
function cleanStyle(node) {
function normalizeStyles(node) {
if (node.nodeType === 1) {
if (node.hasAttribute('style')) {
node.style = node.style.cssText;
}
for (const child of node.childNodes) {
cleanStyle(child);
normalizeStyles(child);
}
}
}

@ -5,7 +5,7 @@ import { rollup } from 'rollup';
import { chromium } from '@playwright/test';
import { deepStrictEqual } from 'assert';
import { loadConfig, loadSvelte, mkdirp, prettyPrintPuppeteerAssertionError } from '../helpers';
import { loadConfig, loadSvelte, mkdirp, prettyPrintBrowserAssertionError } from '../helpers';
const internal = path.resolve('internal/index.mjs');
const index = path.resolve('index.mjs');
@ -214,7 +214,7 @@ describe('runtime (playwright)', () => {
await page.close();
} catch (err) {
failed.add(dir);
prettyPrintPuppeteerAssertionError(err.message);
prettyPrintBrowserAssertionError(err.message);
assertWarnings();
throw err;
}

@ -141,7 +141,7 @@ describe('ssr', () => {
// duplicate client-side tests, as far as possible
runRuntimeSamples('runtime');
runRuntimeSamples('runtime-puppeteer');
runRuntimeSamples('runtime-playwright');
function runRuntimeSamples(suite) {
fs.readdirSync(`test/${suite}/samples`).forEach((dir) => {

Loading…
Cancel
Save