Created
April 18, 2012 08:36
-
-
Save apaatsio/2412073 to your computer and use it in GitHub Desktop.
how to unit test internal functions in jquery plugin?
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
// Define global Test object. You can leave this out in production. | |
Test = Test || {}; | |
(function($) { | |
var someHelperFunction = function(s, d) { | |
return s*d; | |
} | |
var someOtherHelperFunction = function(s) { | |
return s*2; | |
} | |
// here goes the normal plugin code | |
if(typeof Test !== 'undefined') { | |
Test.myPlugin.someHelperFunction = someHelperFunction; | |
Test.myPlugin.someOtherHelperFunction = someOtherHelperFunction; | |
} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment