From c65da5f1cd47d2e2ae97b0f5ada3863430a324da Mon Sep 17 00:00:00 2001 From: matthewp Date: Fri, 21 Jul 2023 20:29:15 +0000 Subject: [PATCH] [ci] format --- packages/astro/components/ViewTransitions.astro | 15 +++++++++------ packages/astro/e2e/view-transitions.test.js | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/astro/components/ViewTransitions.astro b/packages/astro/components/ViewTransitions.astro index ad5a9b0f6..d7703bc82 100644 --- a/packages/astro/components/ViewTransitions.astro +++ b/packages/astro/components/ViewTransitions.astro @@ -48,12 +48,15 @@ const { fallback = 'animate' } = Astro.props as Props; const swap = () => document.documentElement.replaceWith(doc.documentElement); // Wait on links to finish, to prevent FOUC - const links = Array.from(doc.querySelectorAll('head link[rel=stylesheet]')).map(link => new Promise(resolve => { - const c = link.cloneNode(); - ['load', 'error'].forEach(evName => c.addEventListener(evName, resolve)); - document.head.append(c); - })); - if(links.length) { + const links = Array.from(doc.querySelectorAll('head link[rel=stylesheet]')).map( + (link) => + new Promise((resolve) => { + const c = link.cloneNode(); + ['load', 'error'].forEach((evName) => c.addEventListener(evName, resolve)); + document.head.append(c); + }) + ); + if (links.length) { await Promise.all(links); } diff --git a/packages/astro/e2e/view-transitions.test.js b/packages/astro/e2e/view-transitions.test.js index f73b26675..da5252709 100644 --- a/packages/astro/e2e/view-transitions.test.js +++ b/packages/astro/e2e/view-transitions.test.js @@ -128,9 +128,9 @@ test.describe('View Transitions', () => { }); test('Stylesheets in the head are waited on', async ({ page, astro }) => { - page.addListener('console', data => { - console.log(data) - }) + page.addListener('console', (data) => { + console.log(data); + }); // Go to page 1 await page.goto(astro.resolveUrl('/one'));