diff --git a/test/unit-tests/modules/models/Room-test.ts b/test/unit-tests/modules/models/Room-test.ts index d149c8cdf0..51bf8bde7a 100644 --- a/test/unit-tests/modules/models/Room-test.ts +++ b/test/unit-tests/modules/models/Room-test.ts @@ -39,12 +39,14 @@ describe("Room", () => { const room = new Room(sdkRoom); const fn = jest.fn(); + const onSpy = jest.spyOn(sdkRoom, "on"); + const offSpy = jest.spyOn(sdkRoom, "off"); room.name.watch(fn); - expect(sdkRoom.on).toHaveBeenCalledTimes(1); + expect(onSpy).toHaveBeenCalledTimes(1); room.name.unwatch(fn); - expect(sdkRoom.off).toHaveBeenCalledTimes(1); + expect(offSpy).toHaveBeenCalledTimes(1); }); }); });