Skip to content

Commit

Permalink
fix: add isDisposed to mock eventBus
Browse files Browse the repository at this point in the history
  • Loading branch information
adrums86 committed May 3, 2024
1 parent 9086a12 commit a0b8dd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/eme.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ QUnit.test('keystatuseschange triggers keystatuschange on eventBus for each key'
}
callCount[event.keyId][event.status]++;
callCount.total++;
},
isDisposed: () => {
return false;
}
};

Expand Down Expand Up @@ -203,7 +206,10 @@ QUnit.test('keystatuseschange with expired key closes and recreates session', fu
const initData = new Uint8Array([1, 2, 3]);
const mockSession = getMockSession();
const eventBus = {
trigger: (name) => {}
trigger: (name) => {},
isDisposed: () => {
return false;
}
};
let creates = 0;

Expand Down Expand Up @@ -263,7 +269,10 @@ QUnit.test('keystatuseschange with internal-error logs a warning', function(asse
const mockSession = getMockSession();
const warnCalls = [];
const eventBus = {
trigger: (name) => {}
trigger: (name) => {},
isDisposed: () => {
return false;
}
};

videojs.log.warn = (...args) => warnCalls.push(args);
Expand Down
3 changes: 3 additions & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export const getMockEventBus = () => {
calls,
trigger: (event) => {
calls.push(event);
},
isDisposed: () => {
return false;
}
};

Expand Down

0 comments on commit a0b8dd5

Please sign in to comment.