Unit testing is an important and often overlooked part of the development process. It is considered boring by many, and being traditionally difficu...
For further actions, you may consider blocking this person and/or reporting abuse
I have recently discovered the importance of TDD and will soon study how to do it. These guides are invaluable and help me so much to understand the dynamics behind good code. This article is saved in my favorites, thank you very much.
Hi @chiaralyn ! Thank you for the comment :)
It's very motivating to hear you saved the article to your favorites. I'm happy you found it helpful and enjoyable!
There's a new article in this series coming up next week where we'll talk about mocking imported functions with Jest. This will also be our first look into writing solitary unit tests for sociable units. I'd love to hear your thoughts on it once it's published :)
I can't wait to read the new series of articles. It would be really useful and interesting. Thank you so much for your efforts and your kindness!
Great introduction to Jest. Got it fully working in my express 4.17 test bench.
However now I want to use isInteger client-side. I can't use modules in the browser and have to rewrite isInteger as a simple function. Now my Jest unit test doesn't work anymore. I get "isInteger is not a function".
So I am wondering how to test client-side JS with Jest. Should be a simple way to do it but it is not obvious to me.
Thanks for sharing this informative post on unit testing in JavaScript with Jest! It's always valuable to learn about different approaches and techniques. By the way, I recently came across a comprehensive guide on unit testing with Jest that covers various aspects in depth. It provides a step-by-step approach, practical examples, and helpful tips. If you're interested in diving deeper into Jest and expanding your unit testing knowledge, you might find it useful. Keep up the great work with your blog posts
Oh great! Thank you!
You're welcome juanfabiorey :)
I'm currently implementing jest/ unit tests in the application I work on, its my first time and although there are a good amount of examples and jest documentation, your article was straight forward, descriptive, and very helpful. Thanks! I look forward to the following parts in the series.
I have not written any test code in js yet, but your article is nice and simple and also credits to jest, I look forward to write some test code soon
Thank you for the comment Abdeali!
Glad to hear you're going to try your hand at writing tests. Let me know how it goes! :)
How to optimize test execution in pre-commit hook? find answer in my post: dev.to/srshifu/under-the-hood-how-...