PhpStorm 7.1.0 Web Help

On this page:

Configuring the JSTestDriver test runner

You do not need to download the JSTestDriver framework manually. The server and the assertion framework are provided through the JSTestDriver plugin.

The plugin is not bundled with PhpStorm, but it is available from the PhpStorm plugin repository. Once enabled, the plugin is available at the IDE level, that is, you can use it in all your PhpStorm projects.

Install and enable the plugin on the Plugins page of the Settings dialog box as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.

This plugin does the following:

  • Runs the JSTestDriver server that captures an opened browser to execute tests in.
  • During the test creation, detects the unit testing framework the test code complies with, whereupon suggests the Add <test framework> support intention action, provided that the framework is recognized as a PhpStorm JavaScript library and is thus available in the IDE.

Configuring testing frameworks in a project
  1. Download the framework of your choice and configure it as a PhpStorm JavaScript library.
  2. Do one of the following:
    • Add the project folder to the library scope.
    • Enable the framework support on-the-fly during test creation. Write the test as required, position the cursor at it, and press Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt EnterAlt EnterCommand 1. Then choose the Add <test framework> support intention action from the list.
    • To use Jasmine, add jasmine-jstd-adapter to the configuration file.

      Open jsTestDriver.conf and type the following code in it:

      load:
      
      lib/jasmine/jasmine.js
      lib/jasmine-jstd-adapter/JasmineAdapter.js
                                  
      For more details about JSTestDriver configuration files, see Running JavaScript Unit Tests.

See Also

Procedures:

Web Resources: