I was wondering the best way to use jasmine to test external dependencies.
For example I have an overlay module that purely shows and hides a background mask:
function Overlay () {
}
Overlay.prototype.show = function () {
}
Overlay.prototype.hide = function () {
}
This has complete Jasmine unit tests set up.
I then have another module Dialog that uses the overlay Module:
function Dialog () {
}
Dialog.prototype.show() {
//do dialog stuff here, then show overlay
var overlay = new Overlay();
overlay.show();
}
I have Jasmine tests that test all the dialog apart from the overlay. With the assumption that the overlay unit tests are setup and passing does the dialog test just need to ensure that var overlay is defined and that its show method has been called?
For separation of concerns is this the best way to do this?
Thanks in advance