JavaScript Unit Testing Tutorial for Beginners

Sdílet
Vložit
  • čas přidán 4. 06. 2024
  • Write bulletproof JavaScript code with unit testing! 💪 This beginner-friendly tutorial will teach you the essentials for cleaner, more reliable apps.
    Key benefits of unit testing:
    - Catch bugs early in development
    - Boost confidence in your code
    - Write better, more maintainable JavaScript
    🚀 Want more?
    - Check out my full JavaScript Unit Testing Course: bit.ly/javascript-unit-testing
    - Subscribe for more videos like this: goo.gl/6PYaGF
    ✋ Stay connected for updates and exclusive content! Follow me on:
    - Twitter: / moshhamedani
    - Facebook: / programmingwithmosh
    - Instagram: / codewithmosh.official
    - LinkedIn: / codewithmosh
    📖 TABLE OF CONTENT
    0:00:00 Course Intro
    0:01:21 Prerequisites
    0:02:01 Course Structure
    0:04:16 How to Take This Course
    0:05:14 Setting Up the Testing Environment
    0:05:46 Starter Project
    0:06:40 Introduction to Unit Testing
    0:08:19 What is Unit Testing?
    0:13:39 Types of Tests
    0:16:53 Choosing a Testing Framework
    0:18:31 Setting Up Vitest
    0:19:44 Writing Your First Test
    0:29:04 Exercise: Testing fizzBuzz
    0:35:00 Test-Driven Development
    0:42:10 Exercise: Testing Factorial
    #javascript #testing

Komentáře • 106

  • @programmingwithmosh
    @programmingwithmosh  Před měsícem +1

    🚀 Want more?
    - Check out my full JavaScript Unit Testing Course: bit.ly/javascript-unit-testing
    - Subscribe for more videos like this: goo.gl/6PYaGF

    • @jonasn5
      @jonasn5 Před měsícem

      Hello Mosh, I am trying to use this as a baseline to try some of my own js unittest. but I am meeting an issue of initializing when i try to define a custom class in one of the .js files then importing it. Do you have an idea what is causing this issue?

  • @invertedcoder
    @invertedcoder Před 4 měsíci +17

    Mosh sir i started coding by seeing you are my inpiration i hope you keep teaching and make others life better

  • @Tech050-jb5zu
    @Tech050-jb5zu Před 4 měsíci +4

    Thanks a million for the effort you made, Mosh!
    I’m learning Full-Stack development with your Clear & concise CZcams videos.

  • @amirhoseinshams256
    @amirhoseinshams256 Před 4 měsíci +2

    This would be a great and useful course!💥🔥
    دمت گرم داری!❤️

  • @anotherhumanLingLing
    @anotherhumanLingLing Před 13 dny

    Thank you for teaching us all these years!! I come from non-cs background but now I have been working as a software developer for 2 years. Your videos have helped me a lot at work as it helps me being able to learn new languages/concepts quickly !! Thank you!

  • @lorenainfanter.3099
    @lorenainfanter.3099 Před 2 měsíci

    This is the info that I was looking for! Thank you very much. I didn't know anything about testing, but with this video I learnt a lot!! The explanation was very clear and straightforward. Thanks again!!

  • @georgezzz55
    @georgezzz55 Před 4 měsíci

    Thank You! For Your Service! You are a Noce Person Dear Mosh Keep it up

  • @user-tx5yi7bk2r
    @user-tx5yi7bk2r Před 3 měsíci

    It's good to see you back
    But i was really excited to learn more about mechine learning. Please try to do more about it.❤

  • @vdevivaraprasad3588
    @vdevivaraprasad3588 Před 4 měsíci

    I have started learning your React course. That course is osum i have never seen any instructed like you. You are making the coding as fun and also real world examples and projects. That's why everyone likes your style of teaching. But i have one doubt when you're gonna release part 3 of the ultimate react series. Eagerly waiting for that. Anyway thank you❤.

  • @cppexplorery
    @cppexplorery Před 3 měsíci +1

    This man really does cool things. Thanks to him, I started making videos myself. I wish good luck to everyone who is learning. May everything work out for you 💪

  • @harshbansal
    @harshbansal Před 4 měsíci +1

    Thank you thank you thank you
    Ben waiting for this 🥺❤️❤️

  • @abdelalikabou9197
    @abdelalikabou9197 Před 4 měsíci

    Thank you so much mosh . Still learning from you 😉

  • @monkamkelvin9115
    @monkamkelvin9115 Před 4 měsíci +37

    I’m still waiting for your flutter course mosh …. You promised it since the react native course

  • @bmarecords5183
    @bmarecords5183 Před 4 měsíci

    Thanks so much for this course Mosh, you should also prepare one course on integration testing and testing react apps

  • @inspirechristians5789
    @inspirechristians5789 Před 4 měsíci

    Mosh you are my model to be inspired

  • @lebogangsekwati4305
    @lebogangsekwati4305 Před 4 měsíci

    This is the one thing I struggle with the most. I'm so excited for thjs

  • @valeriaguzman9620
    @valeriaguzman9620 Před 4 měsíci

    I learned SQL with your content and I was able to land my first engineering position as a junior SRE ❤ thanks for sharing such valuable content.

    • @kinggrey2511
      @kinggrey2511 Před 4 měsíci

      What does your work mostly consists of ?

  • @kevinemugisha9035
    @kevinemugisha9035 Před 4 měsíci

    Thanks Mosh, we love youuuuu

  • @hosseinjafari2896
    @hosseinjafari2896 Před měsícem

    You're doing amazing.
    Love from Iran😍

  • @russellmoore3418
    @russellmoore3418 Před 2 měsíci

    Excellent video, very well done!

  • @MohammadMansourBone
    @MohammadMansourBone Před 4 měsíci +4

    We have been waiting for this course for a long time 😁

  • @Whisperywolf1269
    @Whisperywolf1269 Před 4 měsíci

    best course ever

  • @reza-bx8em
    @reza-bx8em Před 4 měsíci

    amazing!!!! پرچم همدان بالاست

  • @mehakgrover2174
    @mehakgrover2174 Před 4 měsíci

    Hi Mosh

  • @kipfitpal
    @kipfitpal Před 4 měsíci

    Yay, Mosh is back !!!!

  • @TroyTV5
    @TroyTV5 Před 2 měsíci

    Your tutorials are amazing. Can you do one for Software testing?

  • @gfabasic32
    @gfabasic32 Před 3 měsíci

    Thanks Mosh!

  • @balakrishnaprasad8928
    @balakrishnaprasad8928 Před 3 měsíci

    Mosh Sir I beacame a fan of your teaching. Kindly create a course for Flask Framework and Fast API

  • @Omar-jibril
    @Omar-jibril Před 4 měsíci

    Thanks Mosh

  • @mehmetaydar_QXyGeN
    @mehmetaydar_QXyGeN Před 4 měsíci

    Thank you so much :)

  • @betterstack
    @betterstack Před 3 měsíci

    Great tutorial as always Mosh! If anyone’s looking for more JavaScript tutorials, we’ve released JS logging in Winston and Pino to help the community too 💪

  • @shashankphatkure
    @shashankphatkure Před 2 měsíci

    thankyou very much sir :)

  • @ar-swe
    @ar-swe Před 4 měsíci

    love you mosh

  • @davood7497
    @davood7497 Před 3 měsíci

    Mosh is back 💯💯💯

  • @tsnaw8173
    @tsnaw8173 Před 4 měsíci +1

    Mosh will there be a new react native course? Appreciate your hard work

  • @iffalcontcl6738
    @iffalcontcl6738 Před 4 měsíci

    Hi mosh it would be greatful if you create a course on Machine learning. There is no clear path im seeing, i want the course like how you package things everything as one go ive purchased your react course its great everything is packaged very well. Kindy please consider this request.

  • @techsolutions4652
    @techsolutions4652 Před 4 měsíci

    This is a humble request for making a playlist for Docker and AWS. Thanks in advance.

  • @davidalejandrollanesbojorq63

    Hey, can you tell me what theme you are using?
    Btw, loved your video :)

  • @chandrashekharreddy5380
    @chandrashekharreddy5380 Před 4 měsíci +2

    Ur just awesome

  • @monkamkelvin9115
    @monkamkelvin9115 Před 4 měsíci +3

    Mosh please your flutter course

  • @Bunny_Video1
    @Bunny_Video1 Před 4 měsíci

    OMG, You are getting younger day by day.
    However, sir you are an amazing teacher.

  • @JunaidKhan-hy5rr
    @JunaidKhan-hy5rr Před 4 měsíci +1

    Mosh Please upload project base courses on your websites, also courses on AWS

  • @abzz1290
    @abzz1290 Před 3 měsíci

    Hi, Which extensions are you using? if anyone know please do share.

  • @ashikahmedfahim232
    @ashikahmedfahim232 Před 4 měsíci +2

    Flutter course please

  • @anasouardini
    @anasouardini Před 4 měsíci

    I was about to learn Jest when I switched to wordpress since it appears that it's the only way to get a job as a junior.

  • @abdullaalfaiyaz1890
    @abdullaalfaiyaz1890 Před 3 měsíci

    Hi mosh
    Are there any discounts available for your monthly all course subscription?

  • @user-xq8jq2ex8y
    @user-xq8jq2ex8y Před 3 měsíci

    Hello Mosh, the course 'Angular 4: Beginner to Pro' can not be loaded. Could you check it?

  • @minimalsforlife740
    @minimalsforlife740 Před 4 měsíci

    Love u from the core of my fucking body cells. Im turned into a usd printing machine since I have become a react developer after I started learning to code using ur cources. Hope to see u in paradise in the other world Mosh❤🎉

  • @user-lb2pl9qi6w
    @user-lb2pl9qi6w Před 4 měsíci

    Waiting ❤

  • @AbhishekGupta-ji4pf
    @AbhishekGupta-ji4pf Před 4 měsíci

    Mosh sir, can you please do a comprehensive course on Springboot. Please, its a must after your Java course. Thanks.

  • @ghaatol
    @ghaatol Před 3 měsíci

    Mosh it's amazing watching your tutorials, I've learned a lot from you, can you please share your bashrc file with me.

  • @salamesalehpour
    @salamesalehpour Před 4 měsíci

    دمت گرم

  • @sina127458
    @sina127458 Před 4 měsíci

    Hi mosh, Thanks to you for your videos.
    I from Iran and want to join coding world. But honestly I don't know with coding language is suitable for me.
    I like mobile app creating but I don't have any idea if the job market good or not.
    Can you please help me take the first step?

  • @malikarandolph8187
    @malikarandolph8187 Před 4 měsíci

    I’m a beginner but want to eventually learn how to make my own daily planner mobile app that can be used on Android & iOS. I’ve been watching some of your videos and I love your teaching style. I’ve paid for the All Access Pass on your website but don’t know where to start. What languages should I learn to build my app?

  • @athulliapaulose
    @athulliapaulose Před 3 měsíci

    Waiting for the react testing course ❤

  • @tofaelahmed8255
    @tofaelahmed8255 Před 4 měsíci

    Plz give us a tutorial about asynchronous JavaScript

  • @Bhushantbn
    @Bhushantbn Před 4 měsíci

    Which vs code theme you used??

  • @muhammadayazfaisal6786
    @muhammadayazfaisal6786 Před 4 měsíci

    Sir Mosh can you please make a one huge project on JavaScript that covers every things like DOM, async, await and promises ,events and many more things.

  • @minimalsforlife740
    @minimalsforlife740 Před 4 měsíci

    Pls add course for ci/cd and docker for frontemd devs

  • @SRTIEP
    @SRTIEP Před 3 měsíci +1

    Flutter Mosh Please ❤

  • @user-cg4ft5op9w
    @user-cg4ft5op9w Před 3 měsíci

    Is there a translation of the video into Arabic on your platform? I want to take the Django course???

  • @user-zc1xh4sj7n
    @user-zc1xh4sj7n Před 4 měsíci

    Dang, u really know what your fans want

  • @aminghasemi2621
    @aminghasemi2621 Před 4 měsíci +1

    Hey mosh, Is it possible for you to create a NodeJS course with typescript and nest?
    I mean the nodejs full course is already awesome. But it could be much much better if you add these mastersy topics as well.

  • @LearnwithSSRK
    @LearnwithSSRK Před 3 měsíci

    Pls upload JavaScript full tutorial video

  • @LokeshKumar-tk7ri
    @LokeshKumar-tk7ri Před 4 měsíci +2

    Sir i have been asking for many months for a Complete DSA course using Javascript

    • @merzadev
      @merzadev Před 4 měsíci

      He already published a DSA course using Java they is no need i guess. Don't be married to the languages my thought

  • @ayushmangarg2
    @ayushmangarg2 Před 4 měsíci

    Please make a AIML course please

  • @SabonaMarara
    @SabonaMarara Před 4 měsíci

    please i need full course thanks

  • @gd6noob
    @gd6noob Před 4 měsíci

    Windows vs macOS vs Linux for programming, which do you use and why?

  • @user-ze5ou8se6i
    @user-ze5ou8se6i Před 4 měsíci

    Flutter course would be a killer

  • @ishimweisaac1019
    @ishimweisaac1019 Před 4 měsíci

    This 40 mins was worth watching

  • @adityapatil4287
    @adityapatil4287 Před 4 měsíci

    Is spring boot still in demand in 2024. If yes Sir Mosh can we get a dedicated course on this topic. Please..!!!🙏

  • @fatokihabeeb4254
    @fatokihabeeb4254 Před 3 měsíci

    hello Mosh sir i want to buy your course online but my card and country dosent support international transaction. ill like to know if i can buy the course with crypto currency i really need a fast reply from you sir.

  • @agatanor
    @agatanor Před 4 měsíci

    do you recommend vue js or react for beginners?

    • @_rachid
      @_rachid Před 4 měsíci

      Both are great.
      But you have to make your choice between the two based on the demand in the market you are targeting.

    • @user-zm1of2sf1s
      @user-zm1of2sf1s Před 4 měsíci

      react next

  • @mryasinize
    @mryasinize Před 4 měsíci

    But Mosh, how can I write tests for tests?

  • @raghavenderkuppireddy7158
    @raghavenderkuppireddy7158 Před 4 měsíci

    ❤❤❤❤❤❤

  • @nicolasm.bronner2747
    @nicolasm.bronner2747 Před měsícem

    You lost me on the "terminal" part... what terminal ? If it's on VS Code, it return an error 😥

  • @noorsajee7376
    @noorsajee7376 Před 3 měsíci

    Bro, I'm confused I watched the 48 minutes to learn JavaScript for beginners, i need practical videos to get me an examples from the practical life , to get me better to work as a frontend developer, please can you guide me I'm lost

  • @user-cg4ft5op9w
    @user-cg4ft5op9w Před 3 měsíci

    هل يوجد في منصتكم خاصيه الترجمه للغه العربيه

  • @tomu_sange
    @tomu_sange Před 4 měsíci

    I think this course is mine.

  • @deatho0ne587
    @deatho0ne587 Před 4 měsíci

    Your test are only testing the good cases. What about if a new dev uses those functions that expect numbers but pass an array, string, an object, or something else? I agree with not over-engineering but this is still an issue with Unit test. They give a sense that the code is good but do not always make sure your code will not have bugs.

  • @ojomudamola6674
    @ojomudamola6674 Před 3 měsíci

    How can subscribe with my Nigerian master card on your website, pls i really need this. Pls any discount, exchange rate is really high for a dollar to a naira

  • @neciyvavian5223
    @neciyvavian5223 Před 3 měsíci

    Is this beginners course, you need to really check the Java unit testing because when it come down to Fizz Buzz im getting fail test, im copy everything you did, and it feel like my money is wasted. No type of contact, I feel this is a scam😢

  • @rafeeqshaik7355
    @rafeeqshaik7355 Před 4 měsíci

    Micro services course using nodejs. 😢😢

  • @sen86sen
    @sen86sen Před 6 dny

    I too want to earn like you ... can you please guide me sir.. I lost job when my father heard it he got heart attack and he passed away.. now my mother also not well... no job for more than 6 months ... please guide me sir I am now in a small town and less awareness and less money to thing about that is next in my life...

  • @aryanmangi9707
    @aryanmangi9707 Před 3 měsíci

    Hey mosh let's talk business

  • @flywithoutwingss
    @flywithoutwingss Před 3 měsíci

    I just missed the early price 😅

  • @s.joseph4838
    @s.joseph4838 Před 4 měsíci

    after i finish intro.test.js i go to my terminal and type npm t i get this error: Failed to load url ../src/intro (resolved id: ../src/intro) in C:/Users/snaus/javascript-testing-starter/src/tests/intro.test.js. Does the file exist? please help[

  • @fatokihabeeb4254
    @fatokihabeeb4254 Před 3 měsíci

    hello Mosh sir i want to buy your course online but my card and country dosent support international transaction. ill like to know if i can buy the course with crypto currency i really need a fast reply from you sir.