Skip to content

Commit 830176f

Browse files
committed
test: register the rendition-helper test and fix the lint error
Build the track through a typed const instead of asserting the object literal, which is what @typescript-eslint/consistent-type-assertions wants and matches how audio-track-controller builds its tracks. The test file was also missing from tests/index.js, so it never ran.
1 parent b243141 commit 830176f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎tests/index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import './unit/utils/imsc1-ttml-parser';
5757
import './unit/utils/mediacapabilities-helper';
5858
import './unit/utils/mp4-tools';
5959
import './unit/utils/output-filter';
60+
import './unit/utils/rendition-helper';
6061
import './unit/utils/safe-json-stringify';
6162
import './unit/utils/texttrack-utils';
6263
import './unit/utils/url-tools';

‎tests/unit/utils/rendition-helper.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
} from '../../../src/types/media-playlist';
99

1010
function makeTrack(overrides: Partial<MediaPlaylist>): MediaPlaylist {
11-
return {
11+
const track: MediaPlaylist = {
1212
attrs: new AttrList({}) as MediaAttributes,
1313
bitrate: 0,
1414
autoselect: false,
@@ -19,8 +19,9 @@ function makeTrack(overrides: Partial<MediaPlaylist>): MediaPlaylist {
1919
name: 'n',
2020
type: 'AUDIO',
2121
url: '',
22-
...overrides,
23-
} as MediaPlaylist;
22+
};
23+
24+
return { ...track, ...overrides };
2425
}
2526

2627
describe('matchesOption', function () {

0 commit comments

Comments
 (0)