-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: slight refactor to support rollup #5601
Conversation
* @return {boolean} | ||
* Whether it is a cross domain request or not. | ||
*/ | ||
export const isCrossOrigin = function(url) { | ||
const winLoc = window.location; | ||
export const isCrossOrigin = function(url, winLoc = window.location) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests for this were overriding global/window
using proxyquireify
which is no longer possible. The only thing I could think to do was add a second argument that defaults to the previous value
@@ -252,24 +245,7 @@ QUnit.test('should expose DOM functions', function(assert) { | |||
methods.forEach(name => { | |||
assert.strictEqual(typeof videojs[name], 'function', `function videojs.${name}`); | |||
assert.strictEqual(typeof Dom[name], 'function', `Dom.${name} function exists`); | |||
|
|||
const oldMethod = Dom[name]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test would have required another override
method simliar to the browser module, but it seemed unnecessary. I don't think we needed to check if dom methods were called via deprecated videojs properties. I think its enough just to check that they exist.
62b4b41
to
546a42b
Compare
Now contains changes from #5621 |
8e7fea2
to
50cd7b4
Compare
cbe748f
to
1cb0d19
Compare
c5081ee
to
e5b151c
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
c4e3453
to
8a4b75b
Compare
80d1eca
to
8518638
Compare
8518638
to
e8f233a
Compare
e8f233a
to
e47a528
Compare
e47a528
to
e3bd694
Compare
e3bd694
to
20fb5f1
Compare
20fb5f1
to
578d911
Compare
import TestHelpers from './test-helpers.js'; | ||
import document from 'global/document'; | ||
|
||
QUnit.module('PosterImage', { | ||
beforeEach() { | ||
// Store the original background support so we can test different vals | ||
this.origVal = browser.BACKGROUND_SIZE_SUPPORTED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used anymore.
8792903
to
5df3d2f
Compare
this.oldXMLHttpRequest = XHR.XMLHttpRequest; | ||
this.oldXDomainRequest = XHR.XDomainRequest; | ||
this.xhr = sinon.useFakeXMLHttpRequest(); | ||
XHR.XMLHttpRequest = this.xhr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this not too late to override XHR? That's why previously, we were doing it in the global-shims.js file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests are broken because the rebase didn't notice a conflict between '@videojs/xhr' and 'xhr' in the import at the top. I think it should be fixed now.
5df3d2f
to
38818f8
Compare
fdd889c
to
b8b5390
Compare
In order to start building our tests with rollup we have to make various changes, mostly due to the fact that rollup cannot override imports. See the comments below for more information.
Includes changes from #5621