diff --git a/packages/playground/nospa/__tests__/nospa.spec.ts b/packages/playground/nospa/__tests__/nospa.spec.ts index 55c7a19428b4e4..2f787c7a7b5b54 100644 --- a/packages/playground/nospa/__tests__/nospa.spec.ts +++ b/packages/playground/nospa/__tests__/nospa.spec.ts @@ -8,17 +8,21 @@ const assertNotIndexHtml = async (path: string) => { `This file should only ever be served as /index.html` ) } + test('/index.html is served', async () => { await page.goto(viteTestUrl + '/index.html') const html = await page.innerHTML('body') expect(html).toContain(`This file should only ever be served as /index.html`) }) -test('/ is not served', async () => { - await assertNotIndexHtml('/') -}) -test('/foo/ is not served', async () => { - await assertNotIndexHtml('/foo/') -}) -test('/foo/index.html is not served', async () => { - await assertNotIndexHtml('/foo/index.html') -}) + +if (!process.env.VITE_TEST_BUILD) { + test('/ is not served', async () => { + await assertNotIndexHtml('/') + }) + test('/foo/ is not served', async () => { + await assertNotIndexHtml('/foo/') + }) + test('/foo/index.html is not served', async () => { + await assertNotIndexHtml('/foo/index.html') + }) +}