From e06b3c791e61968fffeaf87ee7b84c60ffec140f Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 14 Oct 2024 17:13:49 +0800 Subject: [PATCH] fix --- e2e/cases/html/title/index.test.ts | 4 ++-- e2e/cases/html/unset-title/index.test.ts | 13 ------------- e2e/cases/html/unset-title/rsbuild.config.ts | 7 ------- e2e/cases/html/unset-title/src/index.js | 1 - 4 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 e2e/cases/html/unset-title/index.test.ts delete mode 100644 e2e/cases/html/unset-title/rsbuild.config.ts delete mode 100644 e2e/cases/html/unset-title/src/index.js diff --git a/e2e/cases/html/title/index.test.ts b/e2e/cases/html/title/index.test.ts index d805e428ca..6cf1394b60 100644 --- a/e2e/cases/html/title/index.test.ts +++ b/e2e/cases/html/title/index.test.ts @@ -18,7 +18,7 @@ test('should generate default title correctly', async () => { expect(html).toContain('Rsbuild App'); }); -test('should allow setting empty title to override default title', async () => { +test('should allow setting empty title to unset the default title', async () => { const rsbuild = await build({ cwd: __dirname, rsbuildConfig: { @@ -34,7 +34,7 @@ test('should allow setting empty title to override default title', async () => { const html = files[Object.keys(files).find((file) => file.endsWith('foo.html'))!]; - expect(html).toContain(''); + expect(html).not.toContain(''); }); test('should generate title correctly', async () => { diff --git a/e2e/cases/html/unset-title/index.test.ts b/e2e/cases/html/unset-title/index.test.ts deleted file mode 100644 index 298f70929c..0000000000 --- a/e2e/cases/html/unset-title/index.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { build } from '@e2e/helper'; -import { expect, test } from '@playwright/test'; - -test('should allow to unset the title tag', async () => { - const rsbuild = await build({ - cwd: __dirname, - }); - const files = await rsbuild.unwrapOutputJSON(); - - const html = - files[Object.keys(files).find((file) => file.endsWith('index.html'))!]; - expect(html).not.toContain('<title>'); -}); diff --git a/e2e/cases/html/unset-title/rsbuild.config.ts b/e2e/cases/html/unset-title/rsbuild.config.ts deleted file mode 100644 index 634e155478..0000000000 --- a/e2e/cases/html/unset-title/rsbuild.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from '@rsbuild/core'; - -export default defineConfig({ - html: { - title: '', - }, -}); diff --git a/e2e/cases/html/unset-title/src/index.js b/e2e/cases/html/unset-title/src/index.js deleted file mode 100644 index 4748527e94..0000000000 --- a/e2e/cases/html/unset-title/src/index.js +++ /dev/null @@ -1 +0,0 @@ -console.log('1');