mirror of
https://github.com/videojs/video.js.git
synced 2025-07-17 01:42:41 +02:00
chore: Remove safe-json-parse (#8790)
## Description Removes an old unmaintained dependency that isn't needed any more. ## Specific Changes proposed Replace safe-json-parse with `JSON.parse` ## Requirements Checklist - [x] Feature implemented / Bug fixed - [ ] If necessary, more likely in a feature request than a bug fix - [x] Change has been verified in an actual browser (Chrome, Firefox, IE) - [ ] Unit Tests updated or fixed - [ ] Docs/guides updated - [ ] Example created ([starter template on JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0)) - [x] Has no DOM changes which impact accessiblilty or trigger warnings (e.g. Chrome issues tab) - [x] Has no changes to JSDoc which cause `npm run docs:api` to error - [ ] Reviewed by Two Core Contributors
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
/* eslint-env qunit */
|
||||
import TestHelpers from './test-helpers.js';
|
||||
import sinon from 'sinon';
|
||||
import window from 'global/window';
|
||||
|
||||
QUnit.module('Setup');
|
||||
|
||||
@ -19,3 +21,20 @@ QUnit.test('should set options from data-setup even if autoSetup is not called b
|
||||
assert.ok(player.options_.playsinline === true);
|
||||
player.dispose();
|
||||
});
|
||||
|
||||
QUnit.test('should log an error if data-setup has invalid JSON', function(assert) {
|
||||
const logError = sinon.spy(window.console, 'error');
|
||||
|
||||
const el = TestHelpers.makeTag();
|
||||
|
||||
el.setAttribute(
|
||||
'data-setup',
|
||||
"{'controls': true}"
|
||||
);
|
||||
|
||||
const player = TestHelpers.makePlayer({}, el);
|
||||
|
||||
assert.ok(logError.calledWith('VIDEOJS:', 'ERROR:', 'data-setup'));
|
||||
player.dispose();
|
||||
window.console.error.restore();
|
||||
});
|
||||
|
Reference in New Issue
Block a user