Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { beforeEach, describe, expect, it, vi } from "vitest";
const loadBundledPluginPublicSurfaceModuleSync = vi.hoisted(() => vi.fn());
vi.mock("./facade-runtime.js", async () => {
const actual = await vi.importActual<typeof import("./facade-runtime.js")>("./facade-ru
ntime.js");
return {
...actual,
loadBundledPluginPublicSurfaceModuleSync,
};
});
describe("plugin-sdk lmstudio-runtime", () => {
beforeEach(() => {
loadBundledPluginPublicSurfaceModuleSync.mockReset();
});
it("keeps the lmstudio runtime facade cold until a helper is used", async () => {
const module = await import("./lmstudio-runtime.js");
expect(loadBundledPluginPublicSurfaceModuleSync).not.toHaveBeenCalled();
expect(module.LMSTUDIO_PROVIDER_ID).toBe("lmstudio");
expect(module.LMSTUDIO_DEFAULT_EMBEDDING_MODEL).toBe("text-embedding-nomic-embed-text-v1.5");
expect(loadBundledPluginPublicSurfaceModuleSync).not.toHaveBeenCalled();
});
it("delegates lmstudio helpers through the bundled runtime facade", async () => {
const resolveLmstudioInferenceBase = vi.fn().mockReturnValue("http://localhost:1234/v1");
loadBundledPluginPublicSurfaceModuleSync.mockReturnValue({
resolveLmstudioInferenceBase,
});
const module = await import("./lmstudio-runtime.js");
expect(module.resolveLmstudioInferenceBase("http://localhost:1234/api/v1/")).toBe(
"http://localhost:1234/v1",
);
expect(loadBundledPluginPublicSurfaceModuleSync).toHaveBeenCalledWith({
dirName: "lmstudio",
artifactBasename: "runtime-api.js",
});
expect(resolveLmstudioInferenceBase).toHaveBeenCalledWith("http://localhost:1234/api/v1/");
});
});
¤ Dauer der Verarbeitung: 0.19 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland