Wednesday, 2 September 2020

What unit test framework for TDD that works with ES6 imports and allows you to step into the code whilst debugging?

In .NET it's very easy to setup a unit test project and test your code directly from the unit test as you develop. You can set breakpoints in your code, run your test and have it hit the breakpoints. It's good for TDD and makes debugging a breeze.In Node this doesn't seem as easy when you're using ES6 style imports. In Jest, for example, most tutorials demonstrate setting up Babel alongside Jest when you're using ES6 imports, but that surely would remove the ability to set breakpoints in the JS code as it's the transpiled Babel code being tested, not your JS directly.Is there a good equivalent here? I am using the experimental-modules flag with Node v12.16.x so I can use import test from "test" rather than require.

Submitted September 02, 2020 at 05:21PM by qa-account

No comments:

Post a Comment