test: refresh plugin loader boundary assertions

This commit is contained in:
Peter Steinberger
2026-05-06 02:24:39 +01:00
parent 538605ff44
commit 601b4819cb
2 changed files with 6 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import { describe, expect, it } from "vitest";
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
const allowedRuntimeResolverRefs = new Set([
"src/commands/doctor.e2e-harness.ts",
"src/infra/outbound/channel-bootstrap.runtime.ts",
"src/plugins/capability-provider-runtime.ts",
"src/plugins/loader.ts",
]);

View File

@@ -8,10 +8,10 @@ import {
resetRegistryJitiMocks,
} from "./test-helpers/registry-jiti-mocks.js";
// plugin-module-loader-cache prefers native require() for compiled .js before falling
// back to jiti. These tests scripts plugin-loading behaviour through the
// source-transform mock — disable the native-require fast path so the mocked source transformer
// stays authoritative for the test fixture files on disk.
// plugin-module-loader-cache prefers native require() for compiled .js before
// falling back to jiti. These tests script plugin-loading behavior through the
// source-transform mock, so force the fallback path and keep the fixture
// transformer authoritative.
vi.mock("./native-module-require.js", () => ({
isJavaScriptModulePath: (_modulePath: string) => false,
tryNativeRequireJavaScriptModule: (_modulePath: string) => ({ ok: false }),
@@ -210,7 +210,7 @@ describe("setup-registry module loader", () => {
);
expect(mocks.createJiti.mock.calls[0]?.[1]).toEqual(
expect.objectContaining({
tryNative: false,
tryNative: true,
}),
);
});