How to debug Tape tests in JetBrains IDE (WebStorm, IDEA, etc.)

Vlad Mystetskyi
Nielsen-TLV-Tech-Blog
2 min readMar 25, 2018

We are using Tape testing framework in majority of our projects both on backend and frontend.

It is really great tool, but one of the biggest problem with it is lack of integrations with IDEs, f.e. WebStorm, IDEA, etc.

Until now, most of our developers couldn’t debug tape tests, so they used console.logs to understand what is going on. In most of the cases it’s enough, but we want to use all the power of modern development tools and debugging, obviously, is one of them.

Tape test is just regular Nodejs script, so running it in the debug mode should be pretty simple. And it is simple!

All you need to do:

  1. Install in your project 2 dev dependencies: babel-register and babel-polyfill (of course, only if you are using things, which should be transpiled by Babel, such as JSX, imports, etc.)
  2. Update WebStorm, IDEA to the latest version (I wasn’t able to make it work with version 2016.1 of WebStorm, but with 2017.3 it works)
  3. Update Nodejs to version 8+ (I tested it with 8.1.4 and later)
  4. Set up configuration in your IDE like this:
Example of WebStorm run configuration

That’s all, you are all set. Just add breakpoint to your test, click “debug” button and enjoy!

--

--

Vlad Mystetskyi
Nielsen-TLV-Tech-Blog

Web Tech lead at Nielsen Marketing Cloud. Fan of open source, testing and new technologies.