Fix tests to work with latest changes to videojs 5
player.tech was renamed to player.tech_ the videojs.xhr must be replaced with sinon differently now since videojs.xhr holds onto a reference to window.XMLHttpRequest
Showing
2 changed files
with
3 additions
and
0 deletions
... | @@ -20,6 +20,8 @@ | ... | @@ -20,6 +20,8 @@ |
20 | setup: function() { | 20 | setup: function() { |
21 | // fake XHRs | 21 | // fake XHRs |
22 | sinonXhr = sinon.useFakeXMLHttpRequest(); | 22 | sinonXhr = sinon.useFakeXMLHttpRequest(); |
23 | videojs.xhr.XMLHttpRequest = sinonXhr; | ||
24 | |||
23 | requests = []; | 25 | requests = []; |
24 | sinonXhr.onCreate = function(xhr) { | 26 | sinonXhr.onCreate = function(xhr) { |
25 | // force the XHR2 timeout polyfill | 27 | // force the XHR2 timeout polyfill |
... | @@ -32,6 +34,7 @@ | ... | @@ -32,6 +34,7 @@ |
32 | }, | 34 | }, |
33 | teardown: function() { | 35 | teardown: function() { |
34 | sinonXhr.restore(); | 36 | sinonXhr.restore(); |
37 | videojs.xhr.XMLHttpRequest = window.XMLHttpRequest; | ||
35 | clock.restore(); | 38 | clock.restore(); |
36 | } | 39 | } |
37 | }); | 40 | }); | ... | ... |
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment