Run and debug unit tests in Typescript

In a previous article, I weighted the pros and cons of writing our unit tests in Typescript (TS) when working on a TS project. In this article, I want to explain how to overcome the challenges of debugging TS unit tests, i.e. hitting a breakpoint in our TS code while executing a test.

The issue here is that TS does not execute per se. Instead, it gets transpiled to JavaScript, which can then run in a browser or Node.js.

The problem statement therefore is: How do we hit a breakpoint in a TS unit test while debugging our code?