diff --git a/packages/playground/assets/__tests__/assets.spec.ts b/packages/playground/assets/__tests__/assets.spec.ts index 191da897858dd5..f65e3009a7aa71 100644 --- a/packages/playground/assets/__tests__/assets.spec.ts +++ b/packages/playground/assets/__tests__/assets.spec.ts @@ -232,6 +232,12 @@ test('new URL(`${dynamic}`, import.meta.url)', async () => { ) }) +test('new URL(`non-existent`, import.meta.url)', async () => { + expect(await page.textContent('.non-existent-import-meta-url')).toMatch( + '/foo/non-existent' + ) +}) + if (isBuild) { test('manifest', async () => { const manifest = readManifest('foo') diff --git a/packages/playground/assets/index.html b/packages/playground/assets/index.html index e33e9a7cdaaf7d..25c889a445b771 100644 --- a/packages/playground/assets/index.html +++ b/packages/playground/assets/index.html @@ -166,6 +166,11 @@

new URL(`./${dynamic}`, import.meta.url,) (with comma)

+

new URL(`non-existent`, import.meta.url)

+

+ +

+

simple script tag import-expression