2022-09-07 18:25:26 +00:00
|
|
|
import { expect } from '@playwright/test';
|
2022-12-14 15:27:15 +00:00
|
|
|
import { testFactory, getErrorOverlayContent } from './test-utils.js';
|
2022-09-07 18:25:26 +00:00
|
|
|
|
2022-12-14 15:27:15 +00:00
|
|
|
const test = testFactory({
|
2022-12-14 15:29:18 +00:00
|
|
|
root: './fixtures/error-cyclic/',
|
2022-12-14 15:27:15 +00:00
|
|
|
});
|
2022-09-07 18:25:26 +00:00
|
|
|
|
|
|
|
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('/'));
|
|
|
|
|
2022-12-14 15:27:15 +00:00
|
|
|
const message = (await getErrorOverlayContent(page)).message;
|
2022-09-07 18:25:26 +00:00
|
|
|
expect(message).toMatch('Cyclic reference');
|
|
|
|
});
|
|
|
|
});
|