I have big Web app (Backbone.js, Marionette, Require.js ...).
Now, I need to make unit tests for my app. I've learned QUnit library yesterday. I was very easy with simple functions. But now, if I want to test my real app, I meet a lot of troubles and questions.
1. How organize file's structure
2. Do I sholud test only events or functions?
3. Can you give me examples of unit test for Backbone, Require js code with QUnit.
Thank you very much.
you are gonna have to replicate your common code in few files, like appilcation start and everything, then inlcude these files in each of the unit test html files. Then you can write tests for each individual views/folders. You can use something like Balnket.js
for checking your coverage.
Remember few ground rules:
sinon.js
) external code being called from this function).