diff options
author | 2023-07-21 20:29:15 +0000 | |
---|---|---|
committer | 2023-07-21 20:29:15 +0000 | |
commit | c65da5f1cd47d2e2ae97b0f5ada3863430a324da (patch) | |
tree | 4823afb2bfdd71082ce0079d1a7e547ee87ed8c5 | |
parent | 274e6753281edde72fcb4af1cf8a9f892ee46127 (diff) | |
download | astro-c65da5f1cd47d2e2ae97b0f5ada3863430a324da.tar.gz astro-c65da5f1cd47d2e2ae97b0f5ada3863430a324da.tar.zst astro-c65da5f1cd47d2e2ae97b0f5ada3863430a324da.zip |
[ci] format
-rw-r--r-- | packages/astro/components/ViewTransitions.astro | 15 | ||||
-rw-r--r-- | 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')); |