remoteWorkspaceRpcContract.test.ts 687 B

1234567891011121314151617
  1. import { describe, expect, it } from "vitest";
  2. import {
  3. REMOTE_WORKSPACE_RPC_CHANNELS,
  4. assertRemoteWorkspaceRpcContract,
  5. } from "../src/host/remoteWorkspaceRpcContract.js";
  6. describe("RemoteWorkspaceRpcContract v1", () => {
  7. it("requires the complete R3 full-forward channel set", () => {
  8. expect(REMOTE_WORKSPACE_RPC_CHANNELS).toContain("genUiService");
  9. const contract = Object.fromEntries(
  10. REMOTE_WORKSPACE_RPC_CHANNELS.map((channel) => [channel, {}]),
  11. );
  12. expect(() => assertRemoteWorkspaceRpcContract(contract)).not.toThrow();
  13. delete contract.oauthService;
  14. expect(() => assertRemoteWorkspaceRpcContract(contract)).toThrow(/oauthService/u);
  15. });
  16. });