fix unit tests

This commit is contained in:
Timo K
2026-01-16 12:43:13 +01:00
parent 5a48820927
commit f5c31626a6
3 changed files with 25 additions and 23 deletions
@@ -183,7 +183,6 @@ describe("Publisher", () => {
beforeEach(() => {
publisher = new Publisher(
scope,
connection,
mockMediaDevices({}),
muteStates,
@@ -192,7 +191,9 @@ describe("Publisher", () => {
);
});
afterEach(() => {});
afterEach(async () => {
await publisher.destroy();
});
it("Should not create tracks if started muted to avoid unneeded permission requests", async () => {
const createTracksSpy = vi.spyOn(
@@ -267,7 +268,6 @@ describe("Publisher", () => {
let publisher: Publisher;
beforeEach(() => {
publisher = new Publisher(
scope,
connection,
mockMediaDevices({}),
muteStates,
@@ -275,6 +275,9 @@ describe("Publisher", () => {
logger,
);
});
afterEach(async () => {
await publisher.destroy();
});
test.each([
{ mutes: { audioEnabled: true, videoEnabled: false } },
@@ -320,7 +323,6 @@ describe("Bug fix", () => {
it("wrongly publish tracks while muted", async () => {
// setLogLevel(`debug`);
const publisher = new Publisher(
scope,
connection,
mockMediaDevices({}),
muteStates,
@@ -356,5 +358,6 @@ describe("Bug fix", () => {
expect(track!.mute).toHaveBeenCalled();
expect(track!.isMuted).toBe(true);
}
await publisher.destroy();
});
});