Use TinyMCE as a module to avoid conflicts when used globally

This commit is contained in:
Jan Jakeš
2019-05-22 14:58:41 +02:00
committed by M. Shull
parent 5e0ac5579e
commit c9ff9be7ec
6 changed files with 29 additions and 6 deletions

View File

@ -4,15 +4,19 @@ var sinonChai = require('sinon-chai');
var chaiJq = require('chai-jq');
var _ = require('underscore');
var jsdom = require('jsdom/lib/old-api.js').jsdom;
var URL = require('url').URL;
chai.use(sinonChai);
chai.use(chaiJq);
global.expect = chai.expect;
global.sinon = sinon;
global.URL = URL;
if (!global.document || !global.window) {
global.document = jsdom('<html><head><script></script></head><body></body></html>', {}, {
global.document = jsdom('<html><head><script></script></head><body></body></html>', {
url: 'http://example.com',
}, {
FetchExternalResources: ['script'],
ProcessExternalResources: ['script'],
MutationEvents: '2.0',