
























@@ -285,7 +285,7 @@ describe("loadBundledEntryExportSync", () => {
285285});
286286287287it("keeps Windows dist sidecar loads off source-transform loading", async () => {
288-const createJiti = vi.fn(() => vi.fn(() => ({ load: 42 })));
288+const createJiti = vi.fn(() => vi.fn(() => ({ load: 0 })));
289289stubPluginModuleLoaderJitiFactory(createJiti as unknown as PluginModuleLoaderFactory);
290290const platformSpy = vi.spyOn(process, "platform", "get").mockReturnValue("win32");
291291@@ -300,22 +300,17 @@ describe("loadBundledEntryExportSync", () => {
300300fs.mkdirSync(pluginRoot, { recursive: true });
301301302302const importerPath = path.join(pluginRoot, "index.js");
303-const helperPath = path.join(pluginRoot, "helper.ts");
303+const helperPath = path.join(pluginRoot, "helper.cjs");
304304fs.writeFileSync(importerPath, "export default {};\n", "utf8");
305-fs.writeFileSync(helperPath, "export const load = 42;\n", "utf8");
305+fs.writeFileSync(helperPath, "module.exports = { load: 42 };\n", "utf8");
306306307307expect(
308308channelEntryContract.loadBundledEntryExportSync<number>(pathToFileURL(importerPath).href, {
309-specifier: "./helper.ts",
309+specifier: "./helper.cjs",
310310exportName: "load",
311311}),
312312).toBe(42);
313-expect(createJiti).toHaveBeenCalledWith(
314-expect.any(String),
315-expect.objectContaining({
316-tryNative: false,
317-}),
318-);
313+expect(createJiti).not.toHaveBeenCalled();
319314} finally {
320315platformSpy.mockRestore();
321316}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。