From e031f0552e279174c4de3f27e130ca3a2d81b464 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Thu, 26 Jun 2025 12:07:34 +0900 Subject: [PATCH] test: remove redundant tests --- e2e/broken-links.spec.ts | 70 ++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/e2e/broken-links.spec.ts b/e2e/broken-links.spec.ts index 67ca410a7..6bbc37353 100644 --- a/e2e/broken-links.spec.ts +++ b/e2e/broken-links.spec.ts @@ -68,6 +68,8 @@ test.describe(`broken-links: normal server`, async () => { }); test.describe('broken-links: static server', () => { + test.skip(({ mode }) => mode !== 'PRD'); + let port: number; let stopApp: () => Promise; test.beforeAll(async () => { @@ -137,43 +139,41 @@ test.describe('broken-links: static server', () => { }); }); -for (const mode of ['DEV', 'PRD'] as const) { - test.describe(`broken-links/dynamic-not-found: ${mode}`, async () => { - let port: number; - let stopApp: () => Promise; - test.beforeAll(async () => { - ({ port, stopApp } = await startApp(mode)); - }); - test.afterAll(async () => { - await stopApp(); - }); +test.describe(`broken-links/dynamic-not-found`, async () => { + let port: number; + let stopApp: () => Promise; + test.beforeAll(async ({ mode }) => { + ({ port, stopApp } = await startApp(mode)); + }); + test.afterAll(async () => { + await stopApp(); + }); - test('access sync page directly', async ({ page }) => { - await page.goto(`http://localhost:${port}/dynamic-not-found/sync`); - await expect(page.getByRole('heading')).toHaveText('Custom not found'); - await expect(page).toHaveTitle('Custom Not Found Title'); - }); + test('access sync page directly', async ({ page }) => { + await page.goto(`http://localhost:${port}/dynamic-not-found/sync`); + await expect(page.getByRole('heading')).toHaveText('Custom not found'); + await expect(page).toHaveTitle('Custom Not Found Title'); + }); - test('access async page directly', async ({ page }) => { - await page.goto(`http://localhost:${port}/dynamic-not-found/async`); - await expect(page.getByRole('heading')).toHaveText('Custom not found'); - await expect(page).toHaveTitle('Custom Not Found Title'); - }); + test('access async page directly', async ({ page }) => { + await page.goto(`http://localhost:${port}/dynamic-not-found/async`); + await expect(page.getByRole('heading')).toHaveText('Custom not found'); + await expect(page).toHaveTitle('Custom Not Found Title'); + }); - test('access sync page with client navigation', async ({ page }) => { - await page.goto(`http://localhost:${port}/`); - await expect(page.getByRole('heading')).toHaveText('Index'); - await page.click("a[href='/dynamic-not-found/sync']"); - await expect(page.getByRole('heading')).toHaveText('Custom not found'); - await expect(page).toHaveTitle('Custom Not Found Title'); - }); + test('access sync page with client navigation', async ({ page }) => { + await page.goto(`http://localhost:${port}/`); + await expect(page.getByRole('heading')).toHaveText('Index'); + await page.click("a[href='/dynamic-not-found/sync']"); + await expect(page.getByRole('heading')).toHaveText('Custom not found'); + await expect(page).toHaveTitle('Custom Not Found Title'); + }); - test('access async page with client navigation', async ({ page }) => { - await page.goto(`http://localhost:${port}/`); - await expect(page.getByRole('heading')).toHaveText('Index'); - await page.click("a[href='/dynamic-not-found/async']"); - await expect(page.getByRole('heading')).toHaveText('Custom not found'); - await expect(page).toHaveTitle('Custom Not Found Title'); - }); + test('access async page with client navigation', async ({ page }) => { + await page.goto(`http://localhost:${port}/`); + await expect(page.getByRole('heading')).toHaveText('Index'); + await page.click("a[href='/dynamic-not-found/async']"); + await expect(page.getByRole('heading')).toHaveText('Custom not found'); + await expect(page).toHaveTitle('Custom Not Found Title'); }); -} +});