Introduction To Testing In JavaScript With Jest
VloĆŸit
- Äas pĆidĂĄn 23. 09. 2019
- Testing is one of those things that people either love or hate. Usually testing is something that is hated, until you work on a project with good tests and you realize how amazing they are. In this video I am going to show you how to get started with testing in JavaScript using Jest. I will talk about the code you need in order to write tests, as well as show you some pitfalls of testing. At the end of the video I will breakdown the importance of testing and some best practices you can adhere to in order to make your tests amazing.
đ Materials/References:
Spread Operator Video: âą Why Is Array/Object De...
Reference Vs Value Video: âą Reference Vs Value In ...
đ§ Concepts Covered:
- How to install Jest
- What unit testing is
- Why testing is important
- How to write unit tests with Jest
- The importance of test coverage
đ Find Me Here:
My Courses: courses.webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
#Jest #WDS #UnitTest
I'm someone who don't comment on videos but whenever I search for a video and see yours, I always choose you. you are the best man
1000% agree.
Notes
- test script: "jest --coverage" will detail what's being tested and what's not
- Unit tests test the smallest part of your code
- toBe() vs toEqual()
i love you mate...
thanlks a million times
This is a developer that truly knows what he's talking about, nonstop, in facts, and fast - short and simple, bite-sized tips to all development. Master branch, honestly.
Nope, he's a normal dev just like us. He just has the power of editing. He got a video on that.
â@ I know, that's not what I'm saying - No matter how much debugging he cuts out, the coding and aesthetics themselves are made by a developer that truly knows what he's talking about.
@@deansprivatearchive I agree. And what reinforces it is his incredible diction
@whats the name/link of that video?
Definitely would be interested in more testing videos. A topic I only really became aware of when I started looking at job postings and my home made projects started getting more complex. Appreciate what you do!
That's awesome. I was just searching on Udemy for a Jest testing course when this popped up. Weird. I'd would really like to see more testing or production deployment ready based courses. Best practices for making app's well tested and properly staged for active use and deploy. It's a topic that is missed very often.
I agree. I want to try to cover more testing related information on this channel since I find it quite enjoyable.
AI : You're welcome. Human.
Please add more video's on testing. Perhaps a course specifically on this subject. I'm sure many people are interested!!
@@BjornBrasse I agree--I would 100% sign up for a full course on this by Kyle. I loved his React course, and recommend it!
This was very well explained and demonstrated, great job Kyle! I think a lot of us would like at least another video going deeper into testing, explaining better practices, and whatnot. Great video, though.
Kyle bro .. i love how you talk smoothly and going step by step without hurry..
This was such a clear and concise explanation; thank you!
Amazing tutorial! I was afraid of start studying this topic because it seemed so hard. Now, this video gives me a more clear idea. Thanks!
This is a really great intro to testing using Jest. It would good to see more testing videos, possibly ones that cover plain vanilla (no framework) javascript and testing functions that manipulate DOM.
Never found a guy so smooth in explanation in 14 minutes.
Thank you for making this video! I have been curious about automated tests but didn't know where to start. I'm highly interested in a test seriesđ
It would be nice to have a Jest course for typescript and Express/React. Really helps us understand how to setup testing for our project
Really really good stuff dude! Coming from nearly a decade of professional Android development, moving to web work, I was hoping to find a succinct explanation about quick setup and coverage. Definitely a thumbs up and a sub from me. I know you're focusing on newer devs a lot, but even at the senior level needing a quick intro, very helpful stuff!
Thanks. I'm going through a job interview and they asked me to run unit tests, so this is really helpful as a start. Really appreciate it
Did everything go well??
I am very interested in more testing videos. This was a great intro for me, and Iâm at that point in my self-teaching to start getting into testing my code! Look forward to more.
Thank you! I would definitely recommend getting stated practicing testing since I found it was a skill that took a ton of practice for me to get good at.
Thanks Kyle,
You are really helpful with your videos, great content, well paced and I love the simplicity of how you make something complicated look simplified.
And yes, I would love more videos on testing, I believe it to be necessary and a must for every developer out there.
Thanks again mate!
Came here for a refresher, last time i wrote tests was in school and i really enjoyed them then so excited to refresh my knowledge
Dude! Test seemed like a mile away before I watch this... I get just enough of it to start trying on my own very nice... thanks
I was broken after they introduced this to me at bootcamp, but you helped explain it very clearly! Thank you.
At least they introduced it to you.. Iâm a recent bootcamp grad currently job searching and getting back to these necessary fundamentals after realizing how ill prepared I am.
Bro SAME
Looking at the mess and Iâm thinking âsooo theyre functions..? But how.. & wtf is toBeâ
đ
OMG. I am a Manual Testing upping my technical skills to become an Automated Tester and it is the first video I see (after months of seriously researching a lower than beginner level tutorial) that really help me write my first Javascript testing script in 5min. Thank you so much.
I'm a testing expert, and I congratulate you. Your explanation is very clear and understandable! Subscribed.
so why the expert like you is watching tutorial for beginners?
The video was in the search and I chose your video. I see your 4 years old video and think that you were tired at that time. In latest videos you are more energetic.). Great videos, Kyle. Thank you.
Using this as a first intro to jest for me. Thanks Kyle!!
Me too. Thanks, Kyle! I'll have a technical interview covering jest and this video was helpful. Now I'm going to dive deeper into it.
Wow, that was amazing, I've got the complete concept of how the test case should look and work, Thanks for the great content Man !!
Thank you very much for this short video. looking forward to see more from you
Fantastic tutorial, I love that it's short. Thanks!
Great video! Was very helpful in starting my journey in writing tests for my code.
you are so inspiring and such a great teacher! thank you for your hard work
Within 14 minutes, this guy made you learn testing even if you know nothing about it. Thanks!!!
Thanks man!! Super easier to have the --coverage, super helpfull, and well explained!! Much appreciated!
Thank you! I love the way you explain everything
That's great kayl ... why you didnt continue this series?đ
Can you create " test(with jest) in react " tutorial series?
Yes please. More testing tutorials :(
Thatâd be dope đ„
kyle*
@@deansprivatearchive ooops.my bad , but take it easy :)
@@deansprivatearchive Punches drywall
Great content as always Kyle!
Thank you, your explanation is really simple. I hope more testing video comes up
This was great! Yes, definitely more testing in JavaScript with next videos please!
i know this was posted a while ago.. but wow.
creating test made so easy..Huge thanks!!!!
I was thinking about unit test is so hard for me before I did it, This video makes me feel easily to against testing.Thank you !
Yes, would like more testing-related videos. That was great. I think my biggest issue is knowing what exactly to prioritize when testing because as you said, you can test almost everything, even though you probably never will.
I would say you should prioritize the core business logic of your code. Essentially whatever code is the most essential to your project should be tested first.
Thank you! Very clear and concise explanation! đ
Thank you for the info! This was really concise, and perfectly helped me figure out this stuff.
You're really simplifying web development
Thanks so much for this video
Wow! you are super great, i was struggling searching for jest course. thank you for your video.
This is an awesome tutorial would want to see more testing tutorials
More!! Need a whole series, and also enzyme + jest please!
Thanks for this video. If you are thinking about continuing this series then I think tutorial on testing in React would be a great help for newbies ;)
Great video! I've known about testing for a while, but I (personally) can't think of a place I'd use it. I know that's a me-issue; not knocking testing. Hopefully, in your next video on testing, you do can walk us through some real world use cases. Keep up the good work! đ
Testing us useful anywhere you have logic in your code. Literally anything in your code can be tested and you should definitley test the critical parts of your code
Great explanation, thank you very much.
he is teaching everything simple. AWESOME
Great video!
Thanks for sharing, Kyle
Man, thank you a lot, yours tutorials are incredible!! Congrats!!
Thank you!
Amazing job for beginners like me, thanks.
The explanation was clear and upto the point. Thank you so much for the video.
Thanks! really nice video!
*adds Test Driven Development to resume*
Good clarity is maintained throughout the video
You just saved my life!! Thank you!!
Very helpful, even though there's a lot more to know about JEST, it's a well rounded primer. Thank you!
Hey Kyle! I know it's a bit late to post a question/comment for this video(considering the date of publish for the video) nevertheless, I have been watching your tuts and coding videos and I genuinely enjoy watching your videos and learn a ton of new things and concepts. I particularly love the specific topics like regex, testing, solid principles etc that you cover, which frankly I didn't came across on most other coding pros' channels. I love these indepth programming topics by the way and hence, it automatically draws me to your channel every now and then. Main question I had was, "what could be the main difference between a normal software(app) testing and the full on Pentesting?".. Generally, I am aware of the definitions and the underlying principles but, I am quite assured that, your answer would defnitely shed some more light on the topics and help me go further in these topics. Thanks for everything, and love you!
Thanks. So clear and understandable, really.
Awesome video, man. Cheers! â€ïž
Helpful video. Please create more testing videos. In particular, snapshot-based testing would be of interest.
Quality content, as usual. Thank you.
If possible, it would be great to see some React testing as well.
Thanks man â€ïž.. Helped a lot... Please create testing videos for entire react and node-express application with best practices â€ïž... Lots of love brother.. Great work â€ïž
You are lucky if you have someone like WDS besides you, and we are lucky as we have WDS on CZcamsđ
Thank you. I am planning to stick around for the long haul, so you don't have to worry about me leaving your side.
Thanks so much. You are, and have been doing a great job for us! More grace!!!
Amazing video Kyle. Can you do a video about testing React with Enzyme?
Thanks man, this was very helpful :)
Watching in 2021 , The most useful tutorial , Thanks man!
Bro Thanks for this amazing video. Actually, I have to write JEST code in our organization. Your video helps me a lot. Please do more videos about JEST.
Your videos are great man! Keep it up!
Dude, awesome! Thanks a lot. đđ
Thanks Kyle, that was a nice start =)
I'd definitely would like a video that writes a full test suite on a small but real-life project that shows how to write proper unit tests beyond the common a + b examples.
I really want to do this, but I need to find the right project first. Most of my CZcams videos are not large enough to make a full video out of testing them.
@@WebDevSimplified Ok. But maybe just a project where you test some very common use cases like logging in / auth, CRUD operations on a 'User' or 'Company'. Simple stuff that is very often done.
Iam watching many testing tutorial but i don't understand then i see your your testing tutorial video then i watch i understand sir teaching is good đ
Thanks bro! Helped a lot!!!
I've watched plural sight for 1 hour.
And YOU have explained this 10x better in 13 mins.
U have my like n sub. If u have a paid channel. I'm ready
Thanks, man Your explanation is another level bro
Want more advance testing videos. Your videos help us a lot. Thanks a ton!
Thanks! I hope to explore more testing videos in the future for sure.
Thank you, amazing work!
this guy is always make things easier
excellent video and well demonstrated thank you đ
Thank you a lot for your explanations! Reaslly find them very useful for me!
loved your work!!
great brother , it helped me 100%
Like
Cool simple introduction to Jest
Thank You :)
Thanks kyle, đ easy to understand for beginner like me
I'm in QA and just learning JavaScript but need to learn Jest for work, this was very helpful
đ„łvery helpful thank you!
great video, i will definetely use this at one point thank you :)
Another Excellent Video.
Could you please record a video on how to test React's components?
And also it would be cool if you could make a video o how to install Jest to Vite's project. I did it, but it was quite a headache - no tutorials were working, I had to google a lot of errors and fix them by myself...
I admit I don't unit test much but I'll give this a go - i like the console and html output
Great video, thank you
Thanks, your explication is easy
Great Video, Thank You!
I would love to see more testing Videos
Thanks Bro for the video...........đđ»đđ»đđ»đđ»đđ»đđ»
Great explanation
Lifesaver! Thanks heaps!
Just came across this channel, not disappointed!
Thank you! I hope you enjoy the rest of my content just as much.