1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-15 01:34:23 +02:00

feat: update exposed utility functions and deprecate several top-level methods of the videojs global (#7761)

This commit is contained in:
Pat O'Neill
2022-05-23 16:23:13 -04:00
parent bd8aebb827
commit 28029d93f4
63 changed files with 1096 additions and 861 deletions

View File

@ -0,0 +1,16 @@
/* eslint-env qunit */
import * as Num from '../../../src/js/utils/num';
QUnit.module('utils/num', function() {
QUnit.module('clamp');
QUnit.test('keep a number between min/max values', function(assert) {
assert.expect(5);
assert.strictEqual(Num.clamp(5, 1, 10), 5);
assert.strictEqual(Num.clamp(5, 1, 5), 5);
assert.strictEqual(Num.clamp(5, 1, 2), 2);
assert.strictEqual(Num.clamp(-1, 1, 10), 1);
assert.strictEqual(Num.clamp(NaN, 1, 10), 1);
});
});