feat: add native module realtime transport
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
type ModuleUiApiClient,
|
||||
type ModuleUiDefinition,
|
||||
type ModuleUiHostContext,
|
||||
type ModuleUiRealtimeClient,
|
||||
parseModuleUiDefinition,
|
||||
parseModuleUiExport,
|
||||
} from "../src/index.js";
|
||||
@@ -19,6 +20,10 @@ function validDefinition(): ModuleUiDefinition {
|
||||
* contract, and this package deliberately does not take a DOM dependency to obtain one. */
|
||||
const noop = (): void => undefined;
|
||||
|
||||
const noopRealtime: ModuleUiRealtimeClient = Object.freeze({
|
||||
subscribe: () => Object.freeze({ close: noop }),
|
||||
});
|
||||
|
||||
function fakeContainer(): Element & { textContent: string } {
|
||||
return { textContent: "" } as unknown as Element & { textContent: string };
|
||||
}
|
||||
@@ -131,6 +136,7 @@ describe("the same module UI artifact hosted by two different hosts", () => {
|
||||
api,
|
||||
principal: { kind: "anonymous" },
|
||||
permissions: { has: () => canPublish },
|
||||
realtime: noopRealtime,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -154,6 +160,7 @@ describe("the same module UI artifact hosted by two different hosts", () => {
|
||||
api,
|
||||
principal: { kind: "anonymous" },
|
||||
permissions: { has: () => canPublish },
|
||||
realtime: noopRealtime,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user