Microsoft has really been pushing ASP.NET MVC, and one of its major strengths over ASP.NET Web Forms is unit testing. Then, they announced that they would support jQuery as their official client-side library for the platform, automatically including the source in new projects. Recently, they announced their first official contributions to the jQuery stack: templating, data linking, and globalization.
With this push to more and more client-side logic, how does Microsoft expect developers to unit test with the same power and flexibility that they offer through MVC?
Is there a unit testing framework for client-side scripting that even comes close to comparing to what is available through ASP.NET MVC? Does Microsoft endorse or offer a specific framework that provides this functionality?
You could take a look at QUnit. I am not sure whether it's or it will be endorsed by Microsoft, but it's what's used to unit test the jQuery framework itself.
I use the following frameworks for JavaScript unit testing:
As for me, it is the best choice if you want test your jQuery functions logic. It was developed by the jQuery developers and works with it well.
This is a BDD framework. It is very useful when you write your tests as specifications for your application.
Both frameworks can be integrated in the test explorer of the Visual Studio 2012 using Chutzpah Test Adapter for Visual Studio 2012.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With