From c88cd9561f094041542ef11206402dd10c4253be Mon Sep 17 00:00:00 2001 From: Kevin Deng Date: Sun, 30 Nov 2025 07:28:01 +0800 Subject: [PATCH] test: absolute url --- tests/index.test.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/index.test.js b/tests/index.test.js index 26d3f85..2d3e125 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -32,7 +32,8 @@ test('import attributes', async () => { pureCJSCache() const { uuid: uuid3, requireESM: requireESM3 } = await import( - './fixtures/mod.js', + // absolute URL + new URL('fixtures/mod.js', import.meta.url).href, { with: { cache: 'no' }, } @@ -55,8 +56,12 @@ test('no-cache protocol', async () => { // @ts-expect-error const mod = JSON.stringify(await import('no-cache://./fixtures/mod.js')) - // @ts-expect-error - const mod2 = JSON.stringify(await import('no-cache://./fixtures/mod.js')) + const mod2 = JSON.stringify( + await import( + // absolute URL + `no-cache://${new URL('fixtures/mod.js', import.meta.url).href}` + ), + ) assert.notEqual(mod, mod2) deregister() -- 2.51.2