A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.jetbrains.com/webstorm/help/code-coverage.html below:

Code coverage | WebStorm Documentation

Code coverage

With WebStorm, you can also monitor how much of your code is covered with tests. WebStorm displays this statistics in a dedicated Coverage tool window and marks covered and uncovered lines visually in the editor and in the Project tool window Alt+1.

The results of a coverage measurement are saved in a coverage suite. You can also merge them with any of the existing suites. In this case, a line is considered covered if it is covered by at least one test run.

Measuring code coverage is available for Jest, Mocha, Karma, and Vitest.

Run tests with coverage Coverage suites

The collection of coverage data for a specific run is called a coverage suite.

WebStorm can display the results for one or more coverage suites at once. If multiple suites are selected, the IDE displays merged results from these suites. This means that a line is considered covered if it was executed in at least one of the selected suites.

The corresponding suite files are located in the WebStorm's system directory:

%LOCALAPPDATA%\JetBrains\WebStorm2025.2\coverage

~/.cache/JetBrains/WebStorm2025.2/coverage

~/Library/Caches/JetBrains/WebStorm2025.2/coverage

Manage suites
  1. In the main menu, go to Ctrl+Alt+F6.

  2. In the Choose Coverage Suite to Display menu:

Read coverage data

WebStorm shows coverage results in:

Code coverage is only supported for the code that belongs to your current project.

Coverage tool window

The tool window shows the percentage of covered lines for each folder and the percentage of covered lines in each file.

The Coverage tool window appears right after you run a configuration with coverage and displays the coverage report. To reopen the Coverage tool window, go to in the main menu, or press Ctrl+Alt+F6.

Code Coverage tool window options

The Coverage tool window has the following options:

Item

Description

If this option is on, WebStorm automatically opens the selected item in the editor. Otherwise, you need to double-click items to open them.

If this option is on, WebStorm automatically locates in the tool window the files that you open in the editor.

Import a coverage suite from disk.

Filter coverage results. You can choose to view only the files with uncommitted changes to focus on recent updates or hide the files that are fully covered with tests.

Coverage results in the editor

When a file is opened in the editor, its lines are highlighted in the gutter according to their coverage status:

To find out how many times a line has been hit, click the color indicator in the gutter. A popup that opens shows the statistic for the line at caret.

Coverage results in the Project tool window

The Project shows the percentage of covered lines for files and directories.

Hide coverage data

Do one of the following:

Configure code coverage
  1. Press Ctrl+Alt+S to open settings and then select .

  2. Define how the collected coverage data will be processed:

  3. Define the behaviour of the Coverage tool window when an application or test is run with coverage:

Change colors of the coverage highlighting
  1. Press Ctrl+Alt+S to open settings and then select .

  2. Alternatively, click in the popup that opens on clicking the coverage indication line in the gutter.

  3. In the list of components, expand the Line Coverage node and select a type of coverage: for example, Full, Partial or Uncovered.

  4. Click the Foreground field to open the Select Color dialog.

  5. Select a color, apply the changes, and close the dialog.

14 May 2025


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4