1c6895884c
* WIP: testing fixes to share the dev server in e2e test suites * temp: testing multiple workers * Revert "temp: testing multiple workers" This reverts commit 9c7bc9d93c9c3f6dd62e3732f878f2d86016b213.
31 lines
745 B
JavaScript
31 lines
745 B
JavaScript
import { expect } from '@playwright/test';
|
|
import { testFactory } from './test-utils.js';
|
|
|
|
const test = testFactory({
|
|
root: './fixtures/invalidate-script-deps/',
|
|
});
|
|
|
|
let devServer;
|
|
|
|
test.beforeAll(async ({ astro }) => {
|
|
devServer = await astro.startDevServer();
|
|
});
|
|
|
|
test.afterAll(async () => {
|
|
await devServer.stop();
|
|
});
|
|
|
|
test.describe('Scripts with dependencies', () => {
|
|
test('refresh with HMR', async ({ page, astro }) => {
|
|
await page.goto(astro.resolveUrl('/'));
|
|
|
|
const h = page.locator('h1');
|
|
await expect(h, 'original text set').toHaveText('before');
|
|
|
|
await astro.editFile('./src/scripts/heading.js', (original) =>
|
|
original.replace('before', 'after')
|
|
);
|
|
|
|
await expect(h, 'text changed').toHaveText('after');
|
|
});
|
|
});
|