There are two powerful JavaScript testing frameworks: QUnit and Jasmine. Using them you can test any JavaScript code. Using ReSharper you can do it quickly and effortlessly right from Visual Studio.
Consider the example below. The isEmail function checks
whether a recently entered e-mail address is correct.

What if this function doesn't work properly? To find it out, you can use QUnit or Jasmine and write a test.
Note
To use QUnit, you should reference qunit.js and
qunit.css files. For more information, see
QUnit Web site
.
To use Jasmine, you should reference jasmine.js and jasmine.css files. For more information, see Jasmine Web site
.
Note
Since ReSharper 7.1 nested references are supported,
so you do not have to reference framework files directly from your files with tests.
You can write the same test using describe, expect and it functions from Jasmine.
ReSharper detects tests automatically.
Click the gutter icon, then click Run.

The test is run in a single session
in the Unit Test Sessions window. As you can see the test has passed,
so the function works properly.

When the tests are started, ReSharper launches the specified browser that runs the tests and
reports the information back to ReSharper.

Optionally, you can set settings so,
that tests are run with PhantomJS library without launching a browser. For more information, see
JavaScript Tests.
You can specify exactly what browser should be used. For more information, see JavaScript Tests.
