fix unit tests
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user