From d18fdecd53093c5bf0c460c6514dd636c2cca446 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Wed, 29 Apr 2026 23:46:39 -0700 Subject: [PATCH] test(channels): align module loader jiti fixture --- src/channels/plugins/module-loader.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/channels/plugins/module-loader.test.ts b/src/channels/plugins/module-loader.test.ts index 0f38abac390..66cfcff43d9 100644 --- a/src/channels/plugins/module-loader.test.ts +++ b/src/channels/plugins/module-loader.test.ts @@ -93,7 +93,7 @@ describe("channel plugin module loader helpers", () => { expect(createJiti).not.toHaveBeenCalled(); }); - it("uses the runtime-supported Jiti boundary for Windows dist loads", async () => { + it("creates the runtime-supported Jiti boundary for Windows dist loads", async () => { const createJiti = vi.fn(() => vi.fn(() => ({ ok: true }))); vi.doMock("jiti", () => ({ createJiti, @@ -108,15 +108,15 @@ describe("channel plugin module loader helpers", () => { const rootDir = createTempDir(); const modulePath = path.join(rootDir, "dist", "extensions", "demo", "index.js"); fs.mkdirSync(path.dirname(modulePath), { recursive: true }); - fs.writeFileSync(modulePath, "export {};\n", "utf8"); + fs.writeFileSync(modulePath, "export const ok = true;\n", "utf8"); - expect( - loaderModule.loadChannelPluginModule({ - modulePath, - rootDir, - shouldTryNativeRequire: () => false, - }), - ).toEqual({ ok: true }); + const loaded = loaderModule.loadChannelPluginModule({ + modulePath, + rootDir, + shouldTryNativeRequire: () => false, + }); + + expect(loaded).toMatchObject({ ok: true }); expect(createJiti).toHaveBeenCalledWith( expect.any(String), expect.objectContaining({