import { expect } from '@playwright/test'; import { testFactory } from './test-utils.js'; const test = testFactory({ root: './fixtures/style-prefetch/' }); test.describe('Style prefetch', () => { test.describe('dev', () => { let devServer; test.beforeEach(async ({ astro }) => { devServer = await astro.startDevServer(); }); test.afterEach(async () => { await devServer.stop(); }); testPrefetch(); }); test.describe('build', () => { let previewServer; test.beforeAll(async ({ astro }) => { await astro.build(); previewServer = await astro.preview(); }); // important: close preview server (free up port and connection) test.afterAll(async () => { await previewServer.stop(); }); testPrefetch(); }); function testPrefetch() { test.describe('prefetches rel="prefetch" links', () => { test('style fetching', async ({ page, astro }) => { const requests = []; page.on('request', (request) => requests.push(request.url())); await page.goto(astro.resolveUrl('/')); await page.waitForLoadState('networkidle'); await expect(requests.filter((req) => req.includes('/style1'))).toBeTruthy(); await expect(requests.filter((req) => req.includes('/style2'))).toBeTruthy(); const cssRequestCount = requests.filter((req) => req.includes('/main.css')).length; await expect(cssRequestCount).toBe(1); }); }); } }); /option> Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/.github/CODEOWNERS (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2023-01-12 Add `.astro/` to `.gitignore` in example projects (#5841)Gravatar Chris Swithinbank 24-98/+46
* Delete committed types in with-content example * Add `.astro/` to `.gitignore` in example projects
2023-01-12chore: update changeset for `_astro` directory (#5843)Gravatar Nate Moore 1-2/+2
Co-authored-by: Nate Moore <nate@astro.build>
2023-01-12fix: pass flags to dev (#5840)Gravatar Sam Chen 3-1/+9
* fix: pass flags to dev * add changeset * Update .changeset/eleven-bulldogs-provide.md Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-12chore: update changelogs, add changeset for `_astro` directory (#5842)Gravatar Nate Moore 5-18/+10
Co-authored-by: Nate Moore <nate@astro.build>
2023-01-12[ci] formatGravatar natemoo-re 1-1/+1
2023-01-12fix(core): handle encoded characters when matching routes (#5836)Gravatar Nate Moore 8-2/+85
Co-authored-by: Nate Moore <nate@astro.build>
2023-01-12Handle compiler breaking change (#5803)Gravatar Bjorn Lu 12-328/+109
2023-01-12fix shiki css class replace logic in md and mdx integrations (#5837)Gravatar Giuseppe La Torre 3-3/+9
2023-01-11[ci] formatGravatar matthewp 2-2/+2
2023-01-11Simplify HMR handling (#5811)Gravatar Bjorn Lu 8-108/+46
* Simplify HMR handling * Try skip test to reveal other test result * Support virtual files * Fix head injection * Revert CI changes * Bring back normalizeFilename * Refactor * Add changeset
2023-01-11[Content collections] Remove experimental flag (#5825)Gravatar Ben Holmes 27-103/+58
* refactor: remove experimental.cc from core * chore: remove experimental flag from tests * fix: mock contentDir in remark tests * fix: check vfile.path in rel-image-error plugin * fix: move .astro/ excludes to all test/fixtures * fix: include test/**/fixtures in ignore * chore: changeset
2023-01-11[Content collections] Improve content config handling (#5824)Gravatar Ben Holmes 5-58/+78
* fix: always generate types on init * fix: skip type generation when no content dir found * fix: avoid stripping `.ts` for existsSync check * chore: changeset * fix: run type gen when content/ dir added in dev
2023-01-11Run sync as part of `astro check` (#5823)Gravatar Chris Swithinbank 3-2/+13
Co-authored-by: Ben Holmes <hey@bholmes.dev>
2023-01-11[ci] update lockfile (#5815)Gravatar Fred K. Bot 1-257/+256
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2023-01-11Fix order-of-execution bug when generating pages (#5822)Gravatar Nate Moore 2-2/+7
* fix: bundle all pages into a single chunk * chore: add changeset Co-authored-by: Nate Moore <nate@astro.build>
2023-01-11Fix `Code.astro` shiki css class replace logic (#5829)Gravatar Giuseppe La Torre 2-1/+6