Unit Testing JavaScript/JQuery in ASP.Net MVC Project using QUnit Step by Step | JavaScript for Line of Business Applications | Scoop.it

The latest Razor View Model of ASP.Net MVC 3/MVC 4 uses considerable amount of JavaScript/JQuery. Sometimes the ActionResult returned by the Controller methods are refined further using JQuery methods before the result in the view. It’s very common when we are returning JSON formatted output from the controller method.

We have various options to run the unit test on the .Net code written within controller. But sometimes it’s required to test those JavaScript/JQuery codes as well, to check the sanity of the output especially in the situation mentioned above.

QUnit (http://nuget.org/packages/QUnit-MVC, a NuGet package) can help us to run such Unit Test.