From f1b6f67109d517219953fc4f0d7e2fae58e01a7e Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Sat, 11 Nov 2023 00:08:31 +0900 Subject: [PATCH] test: fix filename test and manifest windows path test --- .../__tests__/backend-integration.spec.ts | 7 +++---- playground/backend-integration/dir/foo.css | 2 +- playground/backend-integration/frontend/dynamic/foo.css | 3 --- playground/backend-integration/frontend/dynamic/foo.ts | 1 - .../backend-integration/frontend/entrypoints/main.ts | 1 - 5 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 playground/backend-integration/frontend/dynamic/foo.css delete mode 100644 playground/backend-integration/frontend/dynamic/foo.ts diff --git a/playground/backend-integration/__tests__/backend-integration.spec.ts b/playground/backend-integration/__tests__/backend-integration.spec.ts index 7356d8eff15c8c..07558d67ec54ea 100644 --- a/playground/backend-integration/__tests__/backend-integration.spec.ts +++ b/playground/backend-integration/__tests__/backend-integration.spec.ts @@ -37,7 +37,7 @@ describe.runIf(isBuild)('build', () => { const cssAssetEntry = manifest['global.css'] const scssAssetEntry = manifest['nested/blue.scss'] const imgAssetEntry = manifest['../images/logo.png'] - const dirFooAssetEntry = manifest['../dynamic/foo.css'] // '\\' should not be used even on windows + const dirFooAssetEntry = manifest['../../dir/foo.css'] expect(htmlEntry.css.length).toEqual(1) expect(htmlEntry.assets.length).toEqual(1) expect(cssAssetEntry?.file).not.toBeUndefined() @@ -47,10 +47,9 @@ describe.runIf(isBuild)('build', () => { expect(scssAssetEntry?.isEntry).toEqual(true) expect(imgAssetEntry?.file).not.toBeUndefined() expect(imgAssetEntry?.isEntry).toBeUndefined() - expect(dirFooAssetEntry).not.toBeUndefined() + expect(dirFooAssetEntry).not.toBeUndefined() // '\\' should not be used even on windows // use the entry name - expect(manifest['bar.css']).not.toBeUndefined() - expect(manifest['foo.css']).toBeUndefined() + expect(dirFooAssetEntry.file).toMatch('assets/bar-') }) }) diff --git a/playground/backend-integration/dir/foo.css b/playground/backend-integration/dir/foo.css index 1e31c585bebc9c..c2fad7486d3ab6 100644 --- a/playground/backend-integration/dir/foo.css +++ b/playground/backend-integration/dir/foo.css @@ -1,3 +1,3 @@ -.entry-name-foo { +.windows-path-foo { color: blue; } diff --git a/playground/backend-integration/frontend/dynamic/foo.css b/playground/backend-integration/frontend/dynamic/foo.css deleted file mode 100644 index c2fad7486d3ab6..00000000000000 --- a/playground/backend-integration/frontend/dynamic/foo.css +++ /dev/null @@ -1,3 +0,0 @@ -.windows-path-foo { - color: blue; -} diff --git a/playground/backend-integration/frontend/dynamic/foo.ts b/playground/backend-integration/frontend/dynamic/foo.ts deleted file mode 100644 index c2441c49231d80..00000000000000 --- a/playground/backend-integration/frontend/dynamic/foo.ts +++ /dev/null @@ -1 +0,0 @@ -import './foo.css' diff --git a/playground/backend-integration/frontend/entrypoints/main.ts b/playground/backend-integration/frontend/entrypoints/main.ts index d63a57a023847e..f5a332191dd9e4 100644 --- a/playground/backend-integration/frontend/entrypoints/main.ts +++ b/playground/backend-integration/frontend/entrypoints/main.ts @@ -1,5 +1,4 @@ import 'vite/modulepreload-polyfill' -import('../dynamic/foo') // should be dynamic import to split chunks export const colorClass = 'text-black'