I am trying to execute qunit while writing a jQuery plugin, and I was wondering how I can verify the following:
(function($){
$.fn.myPlugin = function(options){
var defaults = {
foo: function(){
return 'bar';
}
};
options = $.extend(defaults, options);
return this.each(function(){ ... });
};
})(jQuery);
This is a simple version of my qunit test:
module('MyPlugin: Configuration');
test('Can overwrite foo', function(){
var mockFoo = function(){
return 'no bar';
};
});
So, I was wondering how can I expose internal methods / members from my plugin inside my tests?
source
share