QUnit (javascript testing framework) #82
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this modifies the Example project so that Home/JSUnitTests contains a number of tests. Advantages of including a javascript testing framework are:
-quick multi browser testing
-tests all the included frameworks, so that updating to newer versions of jQuery, jQuery-UI, columnFilters and dataTables can be done a little more safely
-the interaction between the browser,javascript and the MVC framework becomes testable
potential disadvantages are:
-to avoid an error due to jQuery and jQuery-UI being out of sync (on executing jQuery trigger methods), the version of jQuery-UI has been changed to 1.10.3 - this version does not support IE6 (1.9 was the last version to support this, and if this is an important part of the support matrix, I suspect it will work fine with the latest version of jQuery-UI 1.9.?? - the javascript in the tests is ie6 compatible).
-to avoid code rewrite, the example table has been moved to another partial view (reused by the tests). This might make it a tad harder for people trying to follow the example +/- modify it for their own application.
-the test setup fixture (QUnit.testStart) executes multiple handlers, and when this threw an error (before updating the version of jQuery-UI), firefox would freeze rather than failing tests. This was not the case with chrome or IE11. It may be worth wrapping in a try/catch block, but I need to look at the QUnit code first (as I thought QUnit did this).