Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit testing javascript in visual studio 2008

I want to start unit testing my javascript files as part of my build process in an MVC application I am building using jquery and jqueryUI.

I know how to use qunit and jsunit but I want to try and get VS to run these tests and integrate the results into my build process.

Has anyone got any ideas on where to begin with this? General pointers on where to begin would be as useful as solutions.

like image 276
Matt Smith Avatar asked Jul 09 '09 10:07

Matt Smith


People also ask

Can JavaScript be unit tested?

JavaScript Unit Testing is a method where JavaScript test code is written for a web page or web application module. It is then combined with HTML as an inline event handler and executed in the browser to test if all functionalities are working as desired. These unit tests are then organized in the test suite.

How do I run all unit tests in Visual Studio?

To run all the tests in a default group, choose the Run icon and then choose the group on the menu. Select the individual tests that you want to run, open the right-click menu for a selected test and then choose Run Selected Tests (or press Ctrl + R, T).


1 Answers

Take a lookt at JSUnit MSBuild task. I'm sure there's something similar for qunit, JSSpec, etc.

like image 164
Matthew Groves Avatar answered Oct 12 '22 23:10

Matthew Groves