Up untill now I was used to write all my code inside the ready() function like:
$(document).ready(function() {
// all my code
});
Now I see that with this approach, my code is not "unit testable", e.g. I cannot access the stuff inside ready() from QUnit.
What is the proper way to structure jQuery code that is compatible with using the ready() function and able to be tested?
Is there a good open source code base or project to study and learn from?