I hope most of you SharePoint developers already know NuGet. For those of you who don’t know NuGet – here just a few sentences about NuGet.
NuGet is a package manager for .NET. By using NuGet you can easily setup your projects with your favorite third party libs within no time. In addition to the visual NuGet Package Manager it also adds the Package-Manager-Console to Visual Studio 2010. The Package-Manager Console is just a PowerShell host, which allows you to script your NuGet tasks using PowerShell.
QUnit4SharePoint automatically integrates QUnit in a SharePoint 2010 project. It adds all the required things to your new project.
First you have to open up the NuGet Package Manager – or what I prefer – the NuGet Package Manager Console ( VIEW | OTHER WINDOWS | PACKAGE MANAGER CONSOLE ). Within the Package Manager Console you’ve just to use the Install-Package cmdlet and pass the entire name of my package “DotNetRocks.QUnit4SharePoint”
This SharePoint Element contains a CustomAction which displays a HyperLink within the SharePoint Ribbon Menu to guarantee ease of access. Unfortunately Visual Studio tools for SharePoint do not automatically add this Element to a SharePoint Feature. So in the case that you’d like to see the CustomAction in your environment you have to open up the Feature Designer ( in this example for the “QUnit” Feature) and add the QUnit4SharePoint node.
After completing this you could deploy the WSP. The sample TestSuite shows some simple QUnit tests – just to get an idea of how to use QUnit.