Skip to content

Commit

Permalink
test: Fix exceptions in tests (#4772)
Browse files Browse the repository at this point in the history
This fixes test exceptions that did not fail their tests. One was an
HlsParser instance that outlived the test run and failed after server
disconnection. The other was an exception in AdManager that did not fail
the test, but nonetheless caused an unexpected error to be logged.

Both of these issues were spotted while running the tests in a local
browser in debug mode. Neither caused test failures directly, but both
were examples of poor hygiene in our tests.
  • Loading branch information
joeyparrish committed Dec 8, 2022
1 parent 1bd6216 commit aef7f52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/ads/ad_manager_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ describe('Ad manager', () => {
startedEventB = /** @type {!google.ima.AdEvent} */ (
new shaka.util.FakeEvent(google.ima.AdEvent.Type.STARTED));
startedEventB.getAd = () => {
return {};
return {
isLinear: () => true,
};
};
}
makeMocks();
Expand Down
1 change: 1 addition & 0 deletions test/hls/hls_parser_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('HlsParser', () => {

afterEach(() => {
shaka.log.alwaysWarn = originalAlwaysWarn;
parser.stop();
});

beforeEach(() => {
Expand Down

0 comments on commit aef7f52

Please sign in to comment.