Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run JavaScript unit tests inside of Visual Studio

I have been searching for a good way to run JavaScript unit tests inside of the Visual Studio IDE. I currently use TestDriven.net to run my C# units tests and it is very convenient to be able to quickly get the result of my tests in the output pane. I would love to find a similar experience for JavaScript (ideally working with TestDriven.net).

I have read about different solutions that let you execute JavaScrpt unit tests. Some have their own JS engine while others like JS-Test-Driver are able to send the code to the browsers and fetch the results. But I have yet to see something that is integrated into VS.

Does anyone know of an extension that might do this?

like image 583
Matthew Manela Avatar asked Sep 30 '10 01:09

Matthew Manela


People also ask

How do I run JavaScript test in Visual Studio?

Run tests in Visual Studio You can run the tests by clicking the Run All link in Test Explorer. Or, you can run tests by selecting one or more tests or groups, right-clicking, and selecting Run from the shortcut menu.

How do I add a unit test class in Visual Studio 2017?

In the new project dialog box, find the unit test project to use. Type test in the search box to find a unit test project template for the test framework you want to use, such as MSTest (C#) or the Native Unit Test project (C++), and select it. Starting in Visual Studio 2017 version 14.8, the .

Can we write unit test for JavaScript?

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.


1 Answers

After nine months there are now a couple answers to this question.

I created an open source project called Chutzpah - A JavaScript Test Runner. Chutzpah enables you to run JavaScript unit tests from the command line and from inside of Visual Studio. It also supports running in the TeamCity continuous integration server.

Another solution is part of the next version of Resharper. In Resharper 6 there is an integrated QUnit test runner.

like image 194
Matthew Manela Avatar answered Sep 23 '22 05:09

Matthew Manela