IntelliJ IDEA 12.1.0 Web Help

11.1+
Some features described here are available in Ultimate edition only.

Code Coverage shows how much of your code is covered with tests and marks covered and uncovered lines visually right in the editor.

In this section:

Prerequisites

Note

  1. The JSTestDriver plugin is installed and enabled.

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

  2. Additional third-party testing frameworks, for example, Jasmine or QUnit, are downloaded and integrated with IntelliJ IDEA.
To measure code coverage
  1. Prepare tests manually or have tests generated by IntelliJ IDEA.
  2. Create a test runner configuration file.
  3. Create a run configuration of the type JSTestDriver.

    To have specific files excluded from coverage analysis, specify the paths to them in the Coverage tab of the Run/Debug Configuration: JSTestDriver dialog box.

  4. Start the JSTestDriver server and capture a browser to run the tests in.
  5. On the main toolbar, select the JSTestDriver run configuration in the Run/Debug Configurations drop-down list and click the Run with Coverage button runWithCoverage.
  6. Monitor the code coverage in the Coverage tool window.

See Also

Procedures:

Reference:

Web Resources: