Write ES6 Class mocks for your Jest Unit Tests in TypeScript

Photo by Emil Priver on Unsplash

ES6 Class mocks are nothing new in the Jest world, and indeed the various ways to do them are well documented in the Jest documentation. However, when it comes to TypeScript, things can behave differently, and you might run in some issues. I experienced them and I want to share with you as well as how I worked around them.