fix test not checking for livekit connection state anymore.
This commit is contained in:
@@ -98,7 +98,7 @@ describe("Publisher", () => {
|
|||||||
).mockRejectedValue(Error("testError"));
|
).mockRejectedValue(Error("testError"));
|
||||||
|
|
||||||
await expect(publisher.startPublishing()).rejects.toThrow(
|
await expect(publisher.startPublishing()).rejects.toThrow(
|
||||||
new FailToStartLivekitConnection("testError"),
|
new Error("testError"),
|
||||||
);
|
);
|
||||||
|
|
||||||
// does not try other conenction after the first one failed
|
// does not try other conenction after the first one failed
|
||||||
@@ -106,17 +106,6 @@ describe("Publisher", () => {
|
|||||||
connection.livekitRoom.localParticipant.publishTrack,
|
connection.livekitRoom.localParticipant.publishTrack,
|
||||||
).toHaveBeenCalledTimes(1);
|
).toHaveBeenCalledTimes(1);
|
||||||
|
|
||||||
// failiour due to connection.state$
|
|
||||||
const beforeState = connection.state$.value;
|
|
||||||
(connection.state$ as BehaviorSubject<Error>).next(Error("testStartError"));
|
|
||||||
|
|
||||||
await expect(publisher.startPublishing()).rejects.toThrow(
|
|
||||||
new FailToStartLivekitConnection("testStartError"),
|
|
||||||
);
|
|
||||||
(connection.state$ as BehaviorSubject<ConnectionState | Error>).next(
|
|
||||||
beforeState,
|
|
||||||
);
|
|
||||||
|
|
||||||
// does not try other conenction after the first one failed
|
// does not try other conenction after the first one failed
|
||||||
expect(
|
expect(
|
||||||
connection.livekitRoom.localParticipant.publishTrack,
|
connection.livekitRoom.localParticipant.publishTrack,
|
||||||
|
|||||||
Reference in New Issue
Block a user