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, use QUnit and its functions.
NoteTo use QUnit, you have to include
okfunctions are used. The first argument of the
testfunction defines the name of the test. In our case it coincides with the name of the tested function. The second argument contains code to run and calls the
okfunction. So the test function checks whether correct e-mail address is treated as correct and whether incorrect e-mail address is treated as incorrect.
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.
You can specify exactly what browser should be used. For more information, see