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); const match = /Error: Expected "(.+)" to equal "(.+)"/.exec(message);
if (match) { if (match) {

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

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

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

Loading…
Cancel
Save