File size: 796 Bytes
d9e3e09
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { describe, expect, test } from "bun:test";
import { resolveRuntimeServices, serviceList } from "./runtime-services";

describe("Runtime service composition", () => {
  test("resolves the restricted enterprise profile", () => {
    expect(serviceList(resolveRuntimeServices("meetings"))).toEqual([
      "meetings",
    ]);
  });

  test("rejects unknown modules instead of inferring behavior", () => {
    expect(() => resolveRuntimeServices("meetings,speech-maybe")).toThrow(
      "unknown services: speech-maybe",
    );
  });

  test("keeps the existing full profile when the variable is absent", () => {
    expect(serviceList(resolveRuntimeServices(undefined))).toEqual([
      "realtime-audio",
      "camera",
      "maps",
      "tts",
    ]);
  });
});