Tutorials: JetBrains IDEs tutorial

First you need to install wallaby.js plugin for your IDE, if you haven’t done it yet.

This tutorial demonstrates how to use wallaby.js in WebStorm, IntelliJ IDEA, Rider, PhpStorm, RubyMine, or PyCharm. You may also find a sample calculator project with created run configurations and config files for Mocha, QUnit and Jasmine in this repository.

Configuration file

If you are using Jest >= v24, or Angular CLI >= v8.2, or Vue CLI >= v4, you may use automatic configuration that allows you to start Wallaby without any configuration.

After the plugin is installed, you can start by creating a wallaby configuration file. The configuration file is just a simple JavaScript file in your project’s root with just a couple of mandatory settings. It’s recommended to prefix or suffix it with wallaby, for example wallaby.js.

A simple configuration file would include files and tests (and testFramework, if you are not using jasmine) properties.

module.exports = function () {
  return {
    files: [

    tests: [

The files property should list your source files and other files used by your tests, while the tests property should list your test files. Any test helpers or other test related files that are not the files with actual tests/specs should be listed under the files property. Glob patterns can also be used.

Finally, the testFramework property defines the name and the version of the testing framework you will be (or are) using to write your tests. The supported testing frameworks are listed here.

The configuration file example above assumes that your source files are in the src folder, that you are using Jasmine and your tests are in the test folder and their names end with Spec. Source files locations are specified as patterns, however in many cases the loading order of your source files matters, so you may need to specify some of them one by one.

You can read more about the configuration file format and other settings in the corresponding section.

Note that the tutorial config is using PhantomJs 2 to run tests. You may also use Chrome, Electron, or node.js as an environment to run your tests.

Run configuration

Continue by creating a new wallaby.js Run Configuration. Select Edit configurations from the drop-down menu in the top right-hand corner of the navigation bar, or from the Run menu.

In the configuration you can specify:

  • a name for the newly created configuration,
  • a path to your wallaby.js configuration file,
  • a path to a node.js executable that will be used to run wallaby.js itself (not necessarily your tests).


When you create a Run Configuration, it is recommended to use the node.js version selected by default, unless you really need to change the version for some reason.

Once you have created and saved the configuration, you can start it. The first time you run it, wallaby.js may take a minute or two to install all the dependencies it needs, such as node.js and PhantomJs. It only does this once and then uses the saved dependencies. The dependencies are updated automatically when required.

Once you have started the run configuration, in the bottom right-hand corner of the screen you’ll see the wallaby status indicator. Its job is pretty simple: when it displays a spinner, your tests are running; when it’s red, you have some failing tests; when it’s green, all of your tests are passing.

Tool window

When wallaby.js starts, it also displays a tool window. While writing code, you may not need the window to be opened, so you can collapse it. You can expand it any time by clicking the wallaby.js status indicator (or using the standard way to open a run configuration tool window).


In the tool window you can see the Failing Tests tab and the Wallaby Console tab.

The Failing Tests tab displays all tests that are currently failing along with the error stacks and registered console.log calls. Some bits of the displayed information are hyperlinks that you can use with your mouse or keyboard to navigate to different places, for example to the exact error line, or a failing test, or a place where something is logged to console.

Also, when a test error contains expected and actual properties, the Failing Tests tab displays compact diff view and can display side-by-side diff view. This allows to quickly debug failing equality assertions and snapshots.

Diff views

The Wallaby Console tab also displays some additional information about test execution progress. The tab can also be useful for troubleshooting wallaby.js issues.

Code coverage

Once wallaby.js is running, you can see the code coverage in the source files that it tracks (specified in the configuration file). The coverage is live, so you can start changing your code and the coverage will automatically be updated, just as you type.

As you can see, there are various colored squares displayed for each line of your source code.


  • Gray squares mean that the source line is not covered by any of your tests.
  • Green squares mean that the source line is covered by at least one of your tests.
  • Yellow squares mean that the source line is only partially covered by some of your tests.
  • Red squares mean that the source line is the source of an error or failed expectation, or is in the stack of an error.
  • Pink squares mean that the source line is on the execution path of a failing test.

Clicking a square against a source code line will display a window with the information about the tests covering the line, including any error messages and console.log messages.

You can search inside the window by using standard Cmd/Ctrl + F command and navigate links by using Cmd/Ctrl + B.


Short error messages, expectation failures and console.log messages are also displayed inline, right where and when they happen. This is very convenient as it allows you to avoid context switching and fix the issues in place, as you write your code.

We also recommend reading about some more powerful ways to log things and measure code performance with wallaby.js.

Watch expressions in action

Watch performance in action

Value Explorer

Value Explorer integrates with Wallaby’s existing variable and expression output mechanisms (console.log, live comments, identifier expressions, and the Show Value command) to display values in an easy-to-navigate, real-time tree view. The tree can be expanded to any depth and can copy paths/values to the clipboard.

ValueExplorer in action

Time Travel Debugger

Wallaby’s Time Travel Debugger allows you to move forward and backwards through your code to understand the conditions that led to a specific bug. The Time Travel Debugger accelerates your edit, compile and debug loop by allowing you to jump to a specific line of code, view runtime values, edit-and-continue and step into, over and out of your code.

Time Travel Debugger in action

Test focusing

Sometimes when writing or debugging a test, set of tests or test file for a particular feature, you may need to execute this specific test, set of tests or test file and see code coverage and output only for the specified scope. Wallaby fully supports testing frameworks test focusing functions such as it.only, as well as special comments to focus/skip specific test files.

Wallaby also allows you to start Wallaby for a selected file or folder using the Exclusive Test Run feature. If you have a large test suite which takes long time to run you may use the Start Exclusive Test Run command/menu item that allows you to select a test file or a folder which contains the tests files you would like to focus on and start Wallaby only to run them. If you already have Wallaby started but you would like to focus only on a specific test file or a folder then you may use Add to Exclusive Test Run command/menu item.

To reset the exclusive test run and run all you project tests you may use the Run Project Tests command.

Test filtering

Test Filtering allows you to limit the display of coverage indicators, console messages, live comment messages and errors messages to only the tests that you are working on instead of all tests in your project. You may notice that Test Focusing covers filtering, but there are two key differences between them:

  • The Test Filtering in contrast to the Test Focusing does not re-execute your tests when applying/clearing the filter. When you change from only running selected test(s) to running all tests in your project, all tests are re-run; the Test Filtering does not re-run any tests when the filter is set or cleared.
  • The Test Filtering feature does not actually change Wallaby’s run-time behavior (after any code change, the minimum set of affected tests will be re-run). In contrast, the Test Focusing feature may enable a more efficient workflow for large repositories with many test files, or for slower tests, as Wallaby will only process/run the selected tests.

Wallaby supports three ways of adding and removing tests and test files to/from the test filter:

  • Add test to filter and Remove test from filter context actions
  • Toggle Test Filter action
  • Wallaby App (with full editor synchronization)

You may clear the test filter by clicking on the Reset Test Filter button on the left hand side of your Wallaby Run Configuration window, by executing the Reset Test Filter action or by clicking on the Reset test filter button in Wallaby App.

Context actions

Another way to access some source code line/context actions is to use the light bulb quick actions, or just press Alt + Enter on any line. The actions that you can use include:


  • Show line test(s) action: works similar to clicking a source code line square and displays the line related test data.
  • Jump to failing test action: quickly navigate to the failing test from any ‘pink’ context (the failing test execution path).
  • Jump to error source action: quickly navigate to the source of the test error from any ‘pink’ context (failing test execution path).
  • Show line uncovered regions: this action is useful for “yellow” lines to display what exactly is not covered in the line. Not covered expressions will be highlighted in red.
  • Show assertion data diff: displays the difference between the actual and expected data of the failed assertion (normally an equality one).
  • Show file uncovered regions: similar to the previous action, this displays uncovered regions for the whole file. The red highlights for both actions can be removed by pressing Esc (or you can just start changing the file code and they will disappear).
  • Run line test(s): the action is pretty simple (yet so wanted by so many) – it just runs a single test (if invoked from within the test) or all related tests (if invoked within some source code covered by the tests).
  • Run file test(s): the action runs all tests within the test file it is invoked in, or all tests in all the test files that cover the source file that the action is invoked within.
  • Run project tests: the action runs all tests in your project.
  • Update project snapshots: the command updates all Jest snapshots in your project.
  • Update file snapshots: the command updates all Jest snapshots in the current (focused) file, or all snapshots in all the test files that cover the source file that the action is invoked within.
  • Update test snapshots: the command updates snapshots of a single test (if invoked from within the test) or all snapshots in all related tests (if invoked within some source code covered by the tests).
  • Add test to filter: adds a test to the test filter. The action is available only when editor cursor is on a test declaration line and the test is not added to the filter yet.
  • Remove test from filter: removes a test from the test filter. The action is available only when editor cursor is on a test declaration line and the test is already added to the filter yet.
  • Show last run screen shot: the command displays the screen shot for the last run test (Important note: this feature is only available when running your tests using Chrome and PhantomJs).

All of the described actions can also be mapped to any keyboard shortcuts you prefer for extra productivity. You can do so in Settings - Keymap (search for wallaby in the keymap settings).


The recommended workflow is just to keep wallaby.js up and running as you edit your code. It should pick up existing file changes, file deletion, adding new files and tests (as long as they are listed in files patterns in the configuration file). Wallaby.js does its best to track the dependencies between your files and tests, but occasionally you may need to restart it if your changes are not picked up. You can stop/start wallaby.js any time by stopping/starting the active run configuration.

Search tests

To search and quickly navigate to a test you may use the Search Tests button that is available on the left hand side of your Wallaby Run Configuration window:

Search Tests

Clicking the button runs Jump to Test action that allows to quickly search across all your tests and navigate to the selected test:

Jump To Test

The action can also be mapped to any keyboard shortcut you prefer.

Run only on Save

If you would like to only run your tests when your files are saved to disk, you may update the run mode for your Wallaby session. Two commands are available on the left hand side of your Wallaby Run Configuration window (highlighted in the screenshot below):

  • Make current session Run on any change: the command makes your current Wallaby session start a test run when code is changed in your editor or when code is saved on disk.
  • Make current session Run only on save: the command makes your current Wallaby session start a test run ONLY when code is saved on disk.

JetBrains Run on Save

Important Note: to use the Run only on Save feature, you must first disable auto-save:

  • Go to File > Settings (Ctrl+Alt+S).
    • Go to Appearance & Behavior > System Settings.
      • Make sure the two are unchecked:
        • Save files on frame deactivation
        • Save files automatically if application is idle for x sec.
    • Go to Editor > General > Editor Tabs
      • Put a checkmark on “Mark modified files with asterisk”
      • (Optional but recommended) Under “Tab Closing Policy”, select “Close non-modified files first”. You may also want to increase the number of allowed tabs.
    • Click Apply > OK.

Windows Subsystem for Linux (WSL)

If you are a Windows user wanting to run your Wallaby tests using WSL, you can specify to Use WSL in your Wallaby Run Configuration.

Jetbrains WSL

Trial version

Wallaby is installed with a limited-time feature-complete demo license that periodically prompts you to restart your editor to continue using the tool. Free Trial licenses that allow you to evaluate without prompts and restarts are also available.