Skip to content

Commit

Permalink
test: add autotest
Browse files Browse the repository at this point in the history
  • Loading branch information
Beraliv committed Jan 21, 2019
1 parent 16685b3 commit c4e802c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/unit/hls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Hls from '../../src/hls';

const assert = require('assert');

describe('Hls', () => {
it('should return bandwidth estimate', () => {
let hls = new Hls({ maxStarvationDelay: 4 });
hls.levelController._levels = [
{ bitrate: 105000, name: '144', details: { totalduration: 4, fragments: [{}] } },
{ bitrate: 246440, name: '240', details: { totalduration: 10, fragments: [ {} ] } },
{ bitrate: 460560, name: '380', details: { totalduration: 10, fragments: [ {} ] } },
{ bitrate: 836280, name: '480', details: { totalduration: 10, fragments: [ {} ] } },
{ bitrate: 2149280, name: '720', details: { totalduration: 10, fragments: [ {} ] } },
{ bitrate: 6221600, name: '1080', details: { totalduration: 10, fragments: [ {} ] } }
];
assert.equal(isNaN(hls.bandwidthEstimate), true);
});
});

0 comments on commit c4e802c

Please sign in to comment.