# Testing JavaScript

> **TL;DR**
> Required plugins:
>
>
>
> `JavaScript and TypeScript` -    the plugin is bundled with IntelliJ IDEA and enabled by default.
>
>
>
> `Framework-specific plugin` (if applicable) -    install the plugin on the Settings | Plugins page, tab Marketplace.     The plugin is available only in IntelliJ IDEA with the Ultimate subscription.

> **Note:**
> IntelliJ IDEA provides full testing support only with the Ultimate subscription. Otherwise, only code completion, syntax highlighting, and navigation for tests are available.

You can see the test results in a treeview and easily navigate to the test source from there. Test status is shown next to the test in the editor with an option to quickly run or debug it:

![Run single test from the editor](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_run_test_from_editor.png)

For Jest, Karma, and Mocha you can also see a code coverage report right in IntelliJ IDEA.

## Navigation

IntelliJ IDEA lets you quickly jump from the source code to the related test file with the Go to test action (`Ctrl+Shift+T` (Windows), `⌘ ⇧ T` (macOS), `⌘ ⇧ T` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ T` (macOS System Shortcuts), `Ctrl+Shift+T` (XWin), `Ctrl+Shift+T` (GNOME), `Ctrl+Shift+T` (KDE), `Ctrl+Shift+T` (Emacs), `Ctrl+Shift+T` (Sublime Text), `Ctrl+Shift+T` (Sublime Text (macOS)), `Ctrl+Shift+T` (NetBeans), `Ctrl+Shift+T` (Visual Studio), `Ctrl+Shift+T` (Visual Studio (macOS)), `Ctrl+Shift+T` (Eclipse), `Ctrl+Shift+T` (Eclipse (macOS)) or `Navigate | Test`). For example, from `auth.js` you can jump to `auth.test.js`.

You can also quickly navigate through a test file using the Structure view that shows the names of the tests and suites, as well as other symbols defined in this file.

![Structure view for tests](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_structure_view_for_tests.png)

To jump to the Structure tool window, press `Alt+7` (Windows), `⌘ 7` (macOS), `⌘ 7` (IntelliJ IDEA Classic (macOS)), `⌘ 7` (macOS System Shortcuts), `Alt+7` (XWin), `Alt+7` (GNOME), `Alt+7` (KDE), `Alt+7` (Emacs), `Alt+7` (Sublime Text), `⌘ 7` (Sublime Text (macOS)), `Ctrl+7` (NetBeans), `Ctrl+Alt+F` (Visual Studio), `⌃ ⌥ F` (Visual Studio (macOS)), `Alt+7` (Eclipse), `⌘ 7` (Eclipse (macOS)). Alternatively, press `Ctrl+F12` (Windows), `⌘ F12` (macOS), `⌘ F12` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ 7` (macOS System Shortcuts), `Ctrl+F12` (XWin), `Ctrl+F12` (GNOME), `Ctrl+0` (KDE), `Ctrl+F12` (Emacs), `Ctrl+R` (Sublime Text), `⌘ R` (Sublime Text (macOS)), `Ctrl+F12` (NetBeans), `Alt+\` (Visual Studio), `⌥ \` (Visual Studio (macOS)), `Ctrl+F3` (Eclipse), `⌘ O` (Eclipse (macOS)) to open the Structure view as a popup in the editor.

## Run and debug tests

Before you start with testing JavaScript, make sure the chosen test runner is installed and set up in your project as described on the corresponding page.

During a test debugging session, you can [step through the tests](stepping-through-the-program.html),  [stop and
resume](starting-the-debugger-session.html#pause-resume)  test execution, [examine the test when suspended](examining-suspended-program.html), [run JavaScript code snippets in the Console](interactive-debugger-console.html), and so on.

Procedure: Quickly run or debug a single test with Mocha, Karma, Jest, or Vitest

* To run a test, click ![the Run button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.run.svg) or ![Rerun](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.rerun.svg) in the gutter next to it and select Run <test_name> from the list.

* To debug a test, [set the breakpoints](using-breakpoints.html) where necessary, click ![the Run button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.run.svg) or ![Rerun](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.rerun.svg) in the gutter next to the test, and select Debug <test_name> from the list.

![Run and debug tests from the editor](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_test_run_debug_gutter.png)

Procedure: Create a run/debug configuration

1. In the [Run/Debug Configuration](run-debug-configurations-dialog.html) dialog (`Run | Edit Configurations`), click ![Add New Configuration](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg), and select the appropriate configuration type.

2. Accept the default settings or fill in the required fields with custom values, see Help for specific test frameworks.

Procedure: Run or debug tests using a run/debug configuration

* To run tests, select the required configuration and click ![the Run button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.run.svg) or ![Run with Coverage](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.general.runWithCoverage.svg) in the list of configurations or on the toolbar.

![Run widget: Run Test](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_js_test_run_widget_run.png)

* To debug tests, [set the breakpoints](using-breakpoints.html) where necessary, select the required configuration, and click ![Debug](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.debug.svg) in the list of configurations or on the toolbar.

![Run widget: Debug Test](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_js_test_run_widget_debug.png)

## See also

### Procedures

[Testing frameworks](testing-frameworks.html) [Configure JavaScript libraries](configuring-javascript-libraries.html)

