How do I "think in Qunit" with my own JavaScript libraries ?
I'm familiar with developing in javascript, but now I'd like to start using Qunit (with my applications in HTML/JavaScript).
I make my own libraries. I use public functions and private functions. I also use asynchronous functions (event listeners and callbacks) similar to jQuery:
var mylib;
(function() {
//...
})();
I don't know how to organize that. Here are a few questions to clarify the kind of answers I'm seeking:
- How do I unit test private functions?
- How do I combine hundreds of tests?
- In your experience, what's the best method for organizing the tests? Should I use several HTML files? How should I split the tests between JavaScript files?
Are there QUnit plugins that you recommend for unit testing?
With GitHub, can I use QUnit automatically when I commit? How do you set that up? Maybe with travis-ci?
How do I unit test asynchronous functions? Specifically, what if the functions have a link with LocalStorage (HTML5 Storage) and can interact with other pages (like this)? How can I test that? Should I use an object variable instead of the LocalStorage?
I visited the official website http://qunitjs.com/, but I don't think that the documentation is a good starting point.