diff --git a/packages/astro/e2e/astro-component.test.js b/packages/astro/e2e/astro-component.test.js index 9ab52f597..8d6151f07 100644 --- a/packages/astro/e2e/astro-component.test.js +++ b/packages/astro/e2e/astro-component.test.js @@ -6,11 +6,11 @@ const test = testFactory({ root: './fixtures/astro-component/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/client-only.test.js b/packages/astro/e2e/client-only.test.js index a2db0e0e2..9483c7053 100644 --- a/packages/astro/e2e/client-only.test.js +++ b/packages/astro/e2e/client-only.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/client-only/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/error-react-spectrum.test.js b/packages/astro/e2e/error-react-spectrum.test.js index 0602fd963..63934c9ca 100644 --- a/packages/astro/e2e/error-react-spectrum.test.js +++ b/packages/astro/e2e/error-react-spectrum.test.js @@ -5,13 +5,12 @@ const test = testFactory({ root: './fixtures/error-react-spectrum/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async ({ astro }) => { +test.afterAll(async ({ astro }) => { await devServer.stop(); - astro.resetAllFiles(); }); test.describe('Error: React Spectrum', () => { diff --git a/packages/astro/e2e/error-sass.test.js b/packages/astro/e2e/error-sass.test.js index 30ec0684b..e7b87e105 100644 --- a/packages/astro/e2e/error-sass.test.js +++ b/packages/astro/e2e/error-sass.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/error-sass/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async ({ astro }) => { +test.afterAll(async ({ astro }) => { await devServer.stop(); astro.resetAllFiles(); }); diff --git a/packages/astro/e2e/errors.test.js b/packages/astro/e2e/errors.test.js index 68fd4448d..c29ec0d4f 100644 --- a/packages/astro/e2e/errors.test.js +++ b/packages/astro/e2e/errors.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/errors/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async ({ astro }) => { +test.afterAll(async ({ astro }) => { await devServer.stop(); astro.resetAllFiles(); }); diff --git a/packages/astro/e2e/invalidate-script-deps.test.js b/packages/astro/e2e/invalidate-script-deps.test.js index 811f6bdfd..fe37ece8f 100644 --- a/packages/astro/e2e/invalidate-script-deps.test.js +++ b/packages/astro/e2e/invalidate-script-deps.test.js @@ -7,11 +7,11 @@ const test = testFactory({ let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/lit-component.test.js b/packages/astro/e2e/lit-component.test.js index 827f74119..6603d5b80 100644 --- a/packages/astro/e2e/lit-component.test.js +++ b/packages/astro/e2e/lit-component.test.js @@ -8,7 +8,7 @@ const test = testFactory({ // TODO: configure playwright to handle web component APIs // https://github.com/microsoft/playwright/issues/14241 test.describe('Lit components', () => { - test.beforeEach(() => { + test.beforeAll(() => { delete globalThis.window; }); @@ -16,11 +16,11 @@ test.describe('Lit components', () => { let devServer; const t = test.extend({}); - t.beforeEach(async ({ astro }) => { + t.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); - t.afterEach(async () => { + t.afterAll(async () => { await devServer.stop(); }); @@ -120,11 +120,11 @@ test.describe('Lit components', () => { await astro.build(); }); - t.beforeEach(async ({ astro }) => { + t.beforeAll(async ({ astro }) => { previewServer = await astro.preview(); }); - t.afterEach(async () => { + t.afterAll(async () => { await previewServer.stop(); }); diff --git a/packages/astro/e2e/multiple-frameworks.test.js b/packages/astro/e2e/multiple-frameworks.test.js index b23e8970c..1a73b0229 100644 --- a/packages/astro/e2e/multiple-frameworks.test.js +++ b/packages/astro/e2e/multiple-frameworks.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/multiple-frameworks/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/namespaced-component.test.js b/packages/astro/e2e/namespaced-component.test.js index 8b9766ea7..a23f9ee78 100644 --- a/packages/astro/e2e/namespaced-component.test.js +++ b/packages/astro/e2e/namespaced-component.test.js @@ -7,11 +7,11 @@ const test = testFactory({ let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/nested-in-preact.test.js b/packages/astro/e2e/nested-in-preact.test.js index 8a436c283..a40888c48 100644 --- a/packages/astro/e2e/nested-in-preact.test.js +++ b/packages/astro/e2e/nested-in-preact.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-preact/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/nested-in-react.test.js b/packages/astro/e2e/nested-in-react.test.js index 3c68cc72f..e2d53489a 100644 --- a/packages/astro/e2e/nested-in-react.test.js +++ b/packages/astro/e2e/nested-in-react.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-react/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/nested-in-solid.test.js b/packages/astro/e2e/nested-in-solid.test.js index 8ae71d359..1c4d81ac1 100644 --- a/packages/astro/e2e/nested-in-solid.test.js +++ b/packages/astro/e2e/nested-in-solid.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-solid/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/nested-in-svelte.test.js b/packages/astro/e2e/nested-in-svelte.test.js index e6c866a35..21c896b97 100644 --- a/packages/astro/e2e/nested-in-svelte.test.js +++ b/packages/astro/e2e/nested-in-svelte.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-svelte/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/nested-in-vue.test.js b/packages/astro/e2e/nested-in-vue.test.js index e9c2b1637..813b58149 100644 --- a/packages/astro/e2e/nested-in-vue.test.js +++ b/packages/astro/e2e/nested-in-vue.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-vue/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/nested-recursive.test.js b/packages/astro/e2e/nested-recursive.test.js index ae981189a..0d2583583 100644 --- a/packages/astro/e2e/nested-recursive.test.js +++ b/packages/astro/e2e/nested-recursive.test.js @@ -10,11 +10,11 @@ const test = base.extend({ let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/nested-styles.test.js b/packages/astro/e2e/nested-styles.test.js index c306efa27..ce8ef3cda 100644 --- a/packages/astro/e2e/nested-styles.test.js +++ b/packages/astro/e2e/nested-styles.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-styles/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/pass-js.test.js b/packages/astro/e2e/pass-js.test.js index 618f5868f..503f8274b 100644 --- a/packages/astro/e2e/pass-js.test.js +++ b/packages/astro/e2e/pass-js.test.js @@ -7,11 +7,11 @@ const test = testFactory({ let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/shared-component-tests.js b/packages/astro/e2e/shared-component-tests.js index 3c223d964..db8620835 100644 --- a/packages/astro/e2e/shared-component-tests.js +++ b/packages/astro/e2e/shared-component-tests.js @@ -6,11 +6,11 @@ export function prepareTestFactory(opts) { let devServer; - test.beforeEach(async ({ astro }) => { + test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); - test.afterEach(async () => { + test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/solid-recurse.test.js b/packages/astro/e2e/solid-recurse.test.js index c7ce0ebca..f1fec4030 100644 --- a/packages/astro/e2e/solid-recurse.test.js +++ b/packages/astro/e2e/solid-recurse.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/solid-recurse/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async () => { +test.afterAll(async () => { await devServer.stop(); }); diff --git a/packages/astro/e2e/tailwindcss.test.js b/packages/astro/e2e/tailwindcss.test.js index 9b55d9e73..49b7f3ba1 100644 --- a/packages/astro/e2e/tailwindcss.test.js +++ b/packages/astro/e2e/tailwindcss.test.js @@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/tailwindcss/' }); let devServer; -test.beforeEach(async ({ astro }) => { +test.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); -test.afterEach(async ({ astro }) => { +test.afterAll(async ({ astro }) => { await devServer.stop(); astro.resetAllFiles(); }); diff --git a/packages/astro/e2e/test-utils.js b/packages/astro/e2e/test-utils.js index d02aded1b..030a08512 100644 --- a/packages/astro/e2e/test-utils.js +++ b/packages/astro/e2e/test-utils.js @@ -18,7 +18,7 @@ export function testFactory(inlineConfig) { const test = testBase.extend({ astro: async ({}, use) => { - fixture = await loadFixture(inlineConfig); + fixture = fixture || await loadFixture(inlineConfig); await use(fixture); }, }); diff --git a/packages/astro/e2e/ts-resolution.test.js b/packages/astro/e2e/ts-resolution.test.js index 63991ef4d..08e8eae66 100644 --- a/packages/astro/e2e/ts-resolution.test.js +++ b/packages/astro/e2e/ts-resolution.test.js @@ -26,11 +26,11 @@ test.describe('TypeScript resolution -', () => { let devServer; - t.beforeEach(async ({ astro }) => { + t.beforeAll(async ({ astro }) => { devServer = await astro.startDevServer(); }); - t.afterEach(async () => { + t.afterAll(async () => { await devServer.stop(); }); @@ -44,13 +44,10 @@ test.describe('TypeScript resolution -', () => { t.beforeAll(async ({ astro }) => { await astro.build(); - }); - - t.beforeEach(async ({ astro }) => { previewServer = await astro.preview(); }); - t.afterEach(async () => { + t.afterAll(async () => { await previewServer.stop(); });