astro/packages/astro/e2e/error-cyclic.test.js
Nate Moore 98f242cdcd
Throw helpful errors when attempting to serialize cyclic references (#4646)
* fix(#4332): add helpful error on cyclic references

* chore: add changeset

* test(e2e): add cyclic reference test

* test(e2e): add preact integration

* chore: update lockfile

* fix: ensure vite client is loaded for 500 responses

Co-authored-by: Nate Moore <nate@astro.build>
2022-09-07 13:25:26 -05:00

24 lines
623 B
JavaScript

import { expect } from '@playwright/test';
import { testFactory, getErrorOverlayMessage } from './test-utils.js';
const test = testFactory({ root: './fixtures/error-cyclic/' });
let devServer;
test.beforeEach(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async ({ astro }) => {
await devServer.stop();
astro.resetAllFiles();
});
test.describe('Error: Cyclic Reference', () => {
test('overlay', async ({ page, astro }) => {
await page.goto(astro.resolveUrl('/'));
const message = await getErrorOverlayMessage(page);
expect(message).toMatch('Cyclic reference');
});
});