WebStorm 2017.2 EAP, 172.2465: run single Karma test, better navigation for TypeScript

Please welcome a third WebStorm 2017.2 EAP build (172.2465). You can download it here or install a patch update from the last week EAP build.

Run single Karma test

You can now run or debug a single test or a suite with Karma from the IDE. That way you can save some time and run only those you’re currently working on, instead of running all tests.

To run a test click on the icon next to it on the gutter and select run or debug. Or put the cursor on the test name and hit Ctrl-Shift-R on macOS or Ctrl-Shift-F10 on Windows and Linux to run it. You’ll see the test status icon, green for passed and red for failed, immediately after you’ve run it.

run-karma-test

You might be familiar with this feature if you’re using Mocha or Jest integration in WebStorm.

You can also create and save run/debug configurations for all project tests or for particular suites via Edit configurations… dialog.

Improved navigation in TypeScript

Before, when navigating to a definition of a method from a third-party library in  TypeScript, you often ended up in the .d.ts file. Not anymore! Now, if there are .d.ts and .ts files, Go to definition will take you to the .ts file.

dts-ts

If you’re working with Angular and want to navigate to the Angular sources (that are not available in the npm module), add Angular repository as a separate content root in your project. To do that:

  1. Clone the Angular git repository to a separate directory: git clone git@github.com:angular/angular.git
  2. Open File | Settings | Directories – Add content root and choose the directory with the cloned project.

Create method quick-fix for Angular templates

Now if you hit Alt-Enter on the undefined method in Angular template, you can quickly define it in the corresponding component.

create-method

You can find the full list of issues addressed in this EAP build in the Release notes.

Please report your feedback to our issue tracker. To get notifications of new EAP builds as they become available, subscribe to the EAP channel in Preferences | Appearance & Behavior | System Settings | Updates.

Your WebStorm Team

About Ekaterina Prigara

Ekaterina Prigara is WebStorm product marketing manager at JetBrains. She's passionate about new technologies, UX and coffee.
This entry was posted in Early Access Preview and tagged , , , . Bookmark the permalink.

7 Responses to WebStorm 2017.2 EAP, 172.2465: run single Karma test, better navigation for TypeScript

  1. Amiram says:

    +1 for the navigation. However, most libs don’t come with typing but you have to download them separately from @types. Because the d.ts is not in the same folder of the js file, there is no way to get to the js file.

    • Ekaterina Prigara says:

      This particular improvement is about .ts files and libraries written in TypeScript, not .js files. Go to implementation will take you to the JavaScript file even now.

  2. Shawn says:

    Looking forward to the Single-Karma-Test and TS Navigation features – both are sources of repeated frustration in the current release!

  3. dmx says:

    Can I haz TypeScript-specific (some of this applies to JS as well) keywords categories in Colors & Fonts such as modifiers (private, protected, private, readonly, static, …), control (if, switch, case, break, return…), module (import, export, require), typing (declare, as, indexof, type, interface)
    https://github.com/Microsoft/TypeScript/issues/2536

  4. Georgii says:

    Doesn’t work too well with Jest. It throws an error:

    Error: Could not find a config file based on provided values:
    path: “…”
    Config paths must be specified by either a direct path to a config
    file, or a path to a directory. If directory is given, Jest will try to
    traverse directory tree up, until it finds either “jest.config.js” or
    “package.json”.

    This is because my config file is named “jest.unit.config.js”. This is specified in my “run configurations”, but when I run single tests by clicking little green arrows, it’s not picked up.

    • Ekaterina Prigara says:

      When you run a single test, a new run/debug configuration is created using the default configuration template and not the configuration you’ve created earlier. Please modify the default configuration via Edit configurations – Templates – add a path to your config there.

Leave a Reply

Your email address will not be published. Required fields are marked *