fix connection tests
This commit is contained in:
@@ -36,7 +36,10 @@ import {
|
|||||||
} from "./Connection.ts";
|
} from "./Connection.ts";
|
||||||
import { ObservableScope } from "../../ObservableScope.ts";
|
import { ObservableScope } from "../../ObservableScope.ts";
|
||||||
import { type OpenIDClientParts } from "../../../livekit/openIDSFU.ts";
|
import { type OpenIDClientParts } from "../../../livekit/openIDSFU.ts";
|
||||||
import { FailToGetOpenIdToken } from "../../../utils/errors.ts";
|
import {
|
||||||
|
ElementCallError,
|
||||||
|
FailToGetOpenIdToken,
|
||||||
|
} from "../../../utils/errors.ts";
|
||||||
|
|
||||||
let testScope: ObservableScope;
|
let testScope: ObservableScope;
|
||||||
|
|
||||||
@@ -246,8 +249,11 @@ describe("Start connection states", () => {
|
|||||||
|
|
||||||
capturedState = capturedStates.pop();
|
capturedState = capturedStates.pop();
|
||||||
|
|
||||||
if (capturedState instanceof Error) {
|
if (
|
||||||
expect(capturedState.message).toContain(
|
capturedState instanceof ElementCallError &&
|
||||||
|
capturedState.cause instanceof Error
|
||||||
|
) {
|
||||||
|
expect(capturedState.cause.message).toContain(
|
||||||
"SFU Config fetch failed with exception Error",
|
"SFU Config fetch failed with exception Error",
|
||||||
);
|
);
|
||||||
expect(connection.transport.livekit_alias).toEqual(
|
expect(connection.transport.livekit_alias).toEqual(
|
||||||
@@ -308,8 +314,13 @@ describe("Start connection states", () => {
|
|||||||
|
|
||||||
capturedState = capturedStates.pop();
|
capturedState = capturedStates.pop();
|
||||||
|
|
||||||
if (capturedState instanceof Error) {
|
if (
|
||||||
expect(capturedState.message).toContain("Failed to connect to livekit");
|
capturedState instanceof ElementCallError &&
|
||||||
|
capturedState.cause instanceof Error
|
||||||
|
) {
|
||||||
|
expect(capturedState.cause.message).toContain(
|
||||||
|
"Failed to connect to livekit",
|
||||||
|
);
|
||||||
expect(connection.transport.livekit_alias).toEqual(
|
expect(connection.transport.livekit_alias).toEqual(
|
||||||
livekitFocus.livekit_alias,
|
livekitFocus.livekit_alias,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user