From d8e55eebd90b8fd2fa651eb57dc0ff9629482dfe Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 20 Mar 2026 10:30:28 -0300 Subject: [PATCH] =?UTF-8?q?revert(test):=20restore=20upstream=20jiti=20tes?= =?UTF-8?q?t=20=E2=80=94=20Node=2024.13=20breakage=20is=20upstream=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/loader.git-path-regression.test.ts | 8 ++++---- src/plugins/loader.test.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/loader.git-path-regression.test.ts b/src/plugins/loader.git-path-regression.test.ts index 674f2fd53c0..23ab4f4243d 100644 --- a/src/plugins/loader.git-path-regression.test.ts +++ b/src/plugins/loader.git-path-regression.test.ts @@ -77,9 +77,9 @@ export const copiedRuntimeMarker = { ...__testing.buildPluginLoaderJitiOptions({}), tryNative: false, }); - // Node 24.13+ sealed `require` on ESM module objects, breaking Jiti's sync - // CJS path when tryNative is false. Use the async `.import()` helper instead. - await expect(async () => await withoutAlias.import(copiedChannelRuntime)).rejects.toThrow(); + // The production loader uses sync Jiti evaluation, so this regression test + // should exercise the same seam instead of Jiti's async import helper. + expect(() => withoutAlias(copiedChannelRuntime)).toThrow(); const withAlias = createJiti(jitiBaseUrl, { ...__testing.buildPluginLoaderJitiOptions({ @@ -87,7 +87,7 @@ export const copiedRuntimeMarker = { }), tryNative: false, }); - expect(await withAlias.import(copiedChannelRuntime)).toMatchObject({ + expect(withAlias(copiedChannelRuntime)).toMatchObject({ copiedRuntimeMarker: { PAIRING_APPROVED_MESSAGE: "paired", resolveOutboundSendDep: expect.any(Function), diff --git a/src/plugins/loader.test.ts b/src/plugins/loader.test.ts index a2f93d2ad80..a4bf12fad15 100644 --- a/src/plugins/loader.test.ts +++ b/src/plugins/loader.test.ts @@ -3595,9 +3595,9 @@ export const syntheticRuntimeMarker = { ...__testing.buildPluginLoaderJitiOptions({}), tryNative: false, }); - // Node 24.13+ sealed `require` on ESM module objects, breaking Jiti's sync - // CJS path when tryNative is false. Use the async `.import()` helper instead. - await expect(async () => await withoutAlias.import(copiedChannelRuntime)).rejects.toThrow(); + // The production loader uses sync Jiti evaluation, so this boundary should + // follow the same path instead of the async import helper. + expect(() => withoutAlias(copiedChannelRuntime)).toThrow(); const withAlias = createJiti(jitiBaseUrl, { ...__testing.buildPluginLoaderJitiOptions({ @@ -3605,7 +3605,7 @@ export const syntheticRuntimeMarker = { }), tryNative: false, }); - expect(await withAlias.import(copiedChannelRuntime)).toMatchObject({ + expect(withAlias(copiedChannelRuntime)).toMatchObject({ syntheticRuntimeMarker: { resolveOutboundSendDep: expect.any(Function), },