Skip to content

Commit d41cc2d

Browse files
committed
fix(test): use valid Math.random() return value in DVB A168 test
Replace stub.returns(1) with stub.returns(0.99) since Math.random() returns [0, 1) exclusive. The value 1.0 masked the off-by-one bug because it produced the same result with both formulas.
1 parent dbc828b commit d41cc2d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/unit/test/streaming/streaming.utils.DVBSelector.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ describe('BaseURLResolution/DVBSelector', function () {
141141
expect(secondSelection.dvbPriority).to.equal(3);
142142
expect(secondSelection.serviceLocation).to.equal('C');
143143

144-
// Math.random (called in select()) will return 1
145-
stub.returns(1);
144+
// Math.random (called in select()) will return 0.99 (valid range: [0, 1))
145+
stub.returns(0.99);
146146

147147
blacklist.push(secondSelection.serviceLocation);
148148

0 commit comments

Comments
 (0)