mirror of
https://github.com/videojs/video.js.git
synced 2025-03-17 21:18:27 +02:00
chore(tests): make tests not print out errors (#4141)
This commit is contained in:
parent
61d427c7ee
commit
f95815bcd0
@ -3,7 +3,7 @@ import Html5 from '../../../src/js/tech/html5.js';
|
||||
import TestHelpers from '../test-helpers.js';
|
||||
import sinon from 'sinon';
|
||||
|
||||
QUnit.module('Tracks', {
|
||||
QUnit.module('Audio Tracks', {
|
||||
beforeEach(assert) {
|
||||
this.clock = sinon.useFakeTimers();
|
||||
},
|
||||
|
@ -26,13 +26,11 @@ QUnit.test('can create a html track element with various properties', function(a
|
||||
const kind = 'chapters';
|
||||
const label = 'English';
|
||||
const language = 'en';
|
||||
const src = 'http://www.example.com';
|
||||
|
||||
const htmlTrackElement = new HTMLTrackElement({
|
||||
kind,
|
||||
label,
|
||||
language,
|
||||
src,
|
||||
tech: this.tech
|
||||
});
|
||||
|
||||
@ -40,9 +38,7 @@ QUnit.test('can create a html track element with various properties', function(a
|
||||
assert.equal(htmlTrackElement.kind, kind, 'we have a kind');
|
||||
assert.equal(htmlTrackElement.label, label, 'we have a label');
|
||||
assert.equal(htmlTrackElement.readyState, 0, 'we have a readyState');
|
||||
assert.equal(htmlTrackElement.src, src, 'we have a src');
|
||||
assert.equal(htmlTrackElement.srclang, language, 'we have a srclang');
|
||||
assert.equal(htmlTrackElement.track.cues, null, 'we have a track');
|
||||
});
|
||||
|
||||
QUnit.test('defaults when items not provided', function(assert) {
|
||||
|
@ -4,6 +4,7 @@ import TestHelpers from '../test-helpers.js';
|
||||
import * as Events from '../../../src/js/utils/events.js';
|
||||
import safeParseTuple from 'safe-json-parse/tuple';
|
||||
import window from 'global/window';
|
||||
import Component from '../../../src/js/component.js';
|
||||
|
||||
const tracks = [{
|
||||
kind: 'captions',
|
||||
@ -23,6 +24,14 @@ const defaultSettings = {
|
||||
QUnit.module('Text Track Settings', {
|
||||
beforeEach() {
|
||||
window.localStorage.clear();
|
||||
this.oldComponentFocus = Component.prototype.focus;
|
||||
this.oldComponentBlur = Component.prototype.blur;
|
||||
Component.prototype.focus = function() {};
|
||||
Component.prototype.blur = function() {};
|
||||
},
|
||||
afterEach() {
|
||||
Component.prototype.focus = this.oldComponentFocus;
|
||||
Component.prototype.blur = this.oldComponentBlur;
|
||||
}
|
||||
});
|
||||
|
||||
@ -212,6 +221,7 @@ QUnit.test('if persist option is set, save settings when "done"', function(asser
|
||||
tracks,
|
||||
persistTextTrackSettings: true
|
||||
});
|
||||
|
||||
const oldSaveSettings = TextTrackSettings.prototype.saveSettings;
|
||||
let save = 0;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import TestHelpers from '../test-helpers.js';
|
||||
import document from 'global/document';
|
||||
import sinon from 'sinon';
|
||||
|
||||
QUnit.module('Tracks', {
|
||||
QUnit.module('Text Tracks', {
|
||||
beforeEach(assert) {
|
||||
this.clock = sinon.useFakeTimers();
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user