it("throws a typed missing-backend error when no backend is registered", () => {
expect(() => requireAcpRuntimeBackend()).toThrowError(AcpRuntimeError);
expect(() => requireAcpRuntimeBackend()).toThrowError(/ACP runtime backend is not configured/i);
});
it("resolves the first healthy backend when requireAcpRuntimeBackend has no explicit id", () => { const unhealthyRuntime = createRuntimeStub(); const healthyRuntime = createRuntimeStub();
it("throws a typed unavailable error when the requested backend is unhealthy", () => {
registerAcpRuntimeBackend({
id: "acpx",
runtime: createRuntimeStub(),
healthy: () => false,
});
try {
requireAcpRuntimeBackend("acpx"); thrownew Error("expected requireAcpRuntimeBackend to throw");
} catch (err) {
expect(err).toBeInstanceOf(AcpRuntimeError);
expect((err as AcpRuntimeError).code).toBe("ACP_BACKEND_UNAVAILABLE");
}
});
it("unregisters a backend by id", () => {
registerAcpRuntimeBackend({ id: "acpx", runtime: createRuntimeStub() });
unregisterAcpRuntimeBackend("acpx");
expect(getAcpRuntimeBackend("acpx")).toBeNull();
});
it("keeps backend state on a global registry for cross-loader access", () => { const runtime = createRuntimeStub(); const sharedState = __testing.getAcpRuntimeRegistryGlobalStateForTests();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.