refactor: replace feature globals with typed services
This commit is contained in:
@@ -28,9 +28,12 @@ test("virtual channels expose typed SSE and interception boundaries", async () =
|
||||
const source = await readFile(new URL("../../assets/web/generated/vchan.js", import.meta.url), "utf8");
|
||||
new vm.Script(source).runInContext(context);
|
||||
|
||||
assert.equal(typeof window.vchanHandleSession, "function");
|
||||
assert.equal(typeof window.vchanHandleChannels, "function");
|
||||
assert.equal(typeof window.vchanApplyCapabilities, "function");
|
||||
assert.equal(await window.vchanInterceptMode("USB"), false);
|
||||
assert.equal(await window.vchanInterceptBandwidth(2400), false);
|
||||
const service = window.trx.modules.vchan;
|
||||
assert.equal(typeof service.handleSession, "function");
|
||||
assert.equal(typeof service.handleChannels, "function");
|
||||
assert.equal(typeof service.applyCapabilities, "function");
|
||||
assert.equal(await service.interceptMode("USB"), false);
|
||||
assert.equal(await service.interceptBandwidth(2400), false);
|
||||
assert.equal(window.vchanHandleSession, undefined);
|
||||
assert.equal(window.vchanInterceptBandwidth, undefined);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user