forked from standardbroadcast/videojs-chromecast
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for deprecated function
The deprecated `.extend` method should not be called when the modules are imported. The change in the next commit will allow users of the library to upgrade to video.js version 8 where the `.extend` method has been removed. Issue silvermine#152
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
var expect = require('expect.js'); | ||
|
||
const chromecastButton = require('../src/js/components/ChromecastButton'); | ||
|
||
class ButtonComponentStub {} | ||
|
||
describe('ChromecastButton', function() { | ||
it('should not call videojs.extend', function() { | ||
const videoJsSpy = { | ||
extend: function() { | ||
expect().fail('videojs.extends is deprecated'); | ||
}, | ||
getComponent: function() { | ||
return ButtonComponentStub; | ||
}, | ||
registerComponent: function(_, component) { | ||
expect(component.prototype instanceof ButtonComponentStub).to.be(true); | ||
}, | ||
}; | ||
|
||
chromecastButton(videoJsSpy); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
var expect = require('expect.js'); | ||
|
||
const chromecastTech = require('../src/js/tech/ChromecastTech'); | ||
|
||
class TechComponentStub { | ||
} | ||
|
||
describe('ChromecastTech', function() { | ||
it('should not call videojs.extend', function() { | ||
const videoJsSpy = { | ||
extend: function() { | ||
expect().fail('videojs.extends is deprecated'); | ||
}, | ||
getComponent: function() { | ||
return TechComponentStub; | ||
}, | ||
registerTech: function(_, component) { | ||
expect(component.prototype instanceof TechComponentStub).to.be(true); | ||
}, | ||
}; | ||
|
||
chromecastTech(videoJsSpy); | ||
}); | ||
}); |