Jest Tutorial: Start with Unit Testing in JavaScript & Write Better Code

preview_player
Показать описание
In this tutorial, I'll show you how to kickstart your #JavaScript testing with #Jest and embrace Test Driven Development (#TDD). You'll learn to set up Jest, write your first unit tests and follow the TDD cycle to ensure your code is both robust and reliable. Plus, I'll touch on using Jest to check your test coverage, making sure every part of your code is tested.

🍿 Chapters:
00:00 Intro
01:04 Your First Unit Test
02:13 Jest Test Explorer
03:00 Test Driven Development
05:17 Structuring & Coverage

🧑‍💻 Further information:
Рекомендации по теме
Комментарии
Автор

This is exactly I've been looking for! Thanks!

jch
Автор

I have used jest s lot, but you dont need that always.
Try always the native node test runner.
Works good for normal JavaScript code.
If you use a framework in the frontend, like react, and work with the dom, than tools like jest, vitest, etc is useful.
Check what the tool weak and strong points are.
Jest is easy, many have used it, but if you want to write ESM code without a build step, you have to choose something else, like the native test runner for backend and libraries, or vitest for frontend.

PieterWigboldus