Skip to content

Commit

Permalink
chore(tests): make tests not print out errors (#4141)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Mar 2, 2017
1 parent 61d427c commit f95815b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/unit/tracks/audio-tracks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down
4 changes: 0 additions & 4 deletions test/unit/tracks/html-track-element.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,19 @@ 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
});

assert.equal(typeof htmlTrackElement.default, 'undefined', 'we have a default');
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) {
Expand Down
10 changes: 10 additions & 0 deletions test/unit/tracks/text-track-settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
}
});

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion test/unit/tracks/text-tracks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down

0 comments on commit f95815b

Please sign in to comment.