This means testing single parts of the application or very specific pieces of logic. As a result, you focus on testing in isolation. What is a Unit Test?Ī unit test is built upon the foundation of SOLID and the Single Responsibility Principle. I have used the Jest framework to create these Unit tests. The only hard part I found was getting it to work in NestJS, like many other other server side frameworks such as Spring, due to a reliance on dependency injection and Controller-Service architecture. I actually find it quite satisfying to almost ‘penetrate test’ other peoples code by thoroughly testing all events and watching all the tests light up with green ticks. It’s not that Unit testing is hard it isn’t. I decided to create this article to attempt to plug this gap of documentation. Testing in NestJS has proved to be tricky due to the lack of documentation that surrounds it, however I think I have now cracked it. Unit Testing with NestJS and Jest: A comprehensive tutorial Introduction
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |