mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 11:21:07 +00:00
refactor(plugins): make runtime registry lazy
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { createEmptyPluginRegistry } from "./registry.js";
|
||||
import {
|
||||
getActivePluginRegistry,
|
||||
pinActivePluginHttpRouteRegistry,
|
||||
releasePinnedPluginHttpRouteRegistry,
|
||||
resetPluginRuntimeStateForTest,
|
||||
@@ -14,6 +15,12 @@ describe("plugin runtime route registry", () => {
|
||||
resetPluginRuntimeStateForTest();
|
||||
});
|
||||
|
||||
it("stays empty until a caller explicitly installs or requires a registry", () => {
|
||||
resetPluginRuntimeStateForTest();
|
||||
|
||||
expect(getActivePluginRegistry()).toBeNull();
|
||||
});
|
||||
|
||||
it("keeps the pinned route registry when the active plugin registry changes", () => {
|
||||
const startupRegistry = createEmptyPluginRegistry();
|
||||
const laterRegistry = createEmptyPluginRegistry();
|
||||
|
||||
Reference in New Issue
Block a user