JavaScript Unit Testing Tutorial for Beginners

Поділитися
Вставка
  • Опубліковано 1 чер 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

КОМЕНТАРІ • 106

  • @programmingwithmosh
    @programmingwithmosh  Місяць тому +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 Місяць тому

      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 4 місяці тому +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 4 місяці тому +4

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

  • @anotherhumanLingLing
    @anotherhumanLingLing 10 днів тому

    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 2 місяці тому

    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!!

  • @amirhoseinshams256
    @amirhoseinshams256 4 місяці тому +2

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

  • @cppexplorery
    @cppexplorery 3 місяці тому +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 💪

  • @monkamkelvin9115
    @monkamkelvin9115 4 місяці тому +37

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

  • @vdevivaraprasad3588
    @vdevivaraprasad3588 4 місяці тому

    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❤.

  • @georgezzz55
    @georgezzz55 4 місяці тому

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

  • @user-tx5yi7bk2r
    @user-tx5yi7bk2r 3 місяці тому

    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.❤

  • @harshbansal
    @harshbansal 4 місяці тому +1

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

  • @abdelalikabou9197
    @abdelalikabou9197 4 місяці тому

    Thank you so much mosh . Still learning from you 😉

  • @bmarecords5183
    @bmarecords5183 4 місяці тому

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

  • @MohammadMansourBone
    @MohammadMansourBone 4 місяці тому +4

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

  • @inspirechristians5789
    @inspirechristians5789 4 місяці тому

    Mosh you are my model to be inspired

  • @lebogangsekwati4305
    @lebogangsekwati4305 4 місяці тому

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

  • @russellmoore3418
    @russellmoore3418 2 місяці тому

    Excellent video, very well done!

  • @hosseinjafari2896
    @hosseinjafari2896 Місяць тому

    You're doing amazing.
    Love from Iran😍

  • @valeriaguzman9620
    @valeriaguzman9620 4 місяці тому

    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 4 місяці тому

      What does your work mostly consists of ?

  • @TroyTV5
    @TroyTV5 Місяць тому

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

  • @kevinemugisha9035
    @kevinemugisha9035 4 місяці тому

    Thanks Mosh, we love youuuuu

  • @davidalejandrollanesbojorq63
    @davidalejandrollanesbojorq63 7 днів тому

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

  • @mehakgrover2174
    @mehakgrover2174 3 місяці тому

    Hi Mosh

  • @reza-bx8em
    @reza-bx8em 3 місяці тому

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

  • @Whisperywolf1269
    @Whisperywolf1269 4 місяці тому

    best course ever

  • @iffalcontcl6738
    @iffalcontcl6738 4 місяці тому

    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.

  • @gfabasic32
    @gfabasic32 3 місяці тому

    Thanks Mosh!

  • @Omar-jibril
    @Omar-jibril 4 місяці тому

    Thanks Mosh

  • @shashankphatkure
    @shashankphatkure 2 місяці тому

    thankyou very much sir :)

  • @tsnaw8173
    @tsnaw8173 4 місяці тому +1

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

  • @balakrishnaprasad8928
    @balakrishnaprasad8928 3 місяці тому

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

  • @mehmetaydar_QXyGeN
    @mehmetaydar_QXyGeN 4 місяці тому

    Thank you so much :)

  • @Bunny_Video1
    @Bunny_Video1 3 місяці тому

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

  • @monkamkelvin9115
    @monkamkelvin9115 4 місяці тому +3

    Mosh please your flutter course

  • @betterstack
    @betterstack 2 місяці тому

    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 💪

  • @techsolutions4652
    @techsolutions4652 4 місяці тому

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

  • @ar-swe
    @ar-swe 4 місяці тому

    love you mosh

  • @kipfitpal
    @kipfitpal 4 місяці тому

    Yay, Mosh is back !!!!

  • @JunaidKhan-hy5rr
    @JunaidKhan-hy5rr 4 місяці тому +1

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

  • @abdullaalfaiyaz1890
    @abdullaalfaiyaz1890 3 місяці тому

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

  • @minimalsforlife740
    @minimalsforlife740 4 місяці тому

    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❤🎉

  • @malikarandolph8187
    @malikarandolph8187 4 місяці тому

    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?

  • @SRTIEP
    @SRTIEP 2 місяці тому +1

    Flutter Mosh Please ❤

  • @chandrashekharreddy5380
    @chandrashekharreddy5380 4 місяці тому +2

    Ur just awesome

  • @sina127458
    @sina127458 4 місяці тому

    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?

  • @davood7497
    @davood7497 3 місяці тому

    Mosh is back 💯💯💯

  • @abzz1290
    @abzz1290 3 місяці тому

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

  • @anasouardini
    @anasouardini 4 місяці тому

    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.

  • @AbhishekGupta-ji4pf
    @AbhishekGupta-ji4pf 3 місяці тому

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

  • @ashikahmedfahim232
    @ashikahmedfahim232 4 місяці тому +2

    Flutter course please

  • @athulliapaulose
    @athulliapaulose 3 місяці тому

    Waiting for the react testing course ❤

  • @ghaatol
    @ghaatol 3 місяці тому

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

  • @Bhushantbn
    @Bhushantbn 3 місяці тому

    Which vs code theme you used??

  • @user-lb2pl9qi6w
    @user-lb2pl9qi6w 4 місяці тому

    Waiting ❤

  • @LokeshKumar-tk7ri
    @LokeshKumar-tk7ri 4 місяці тому +2

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

    • @merzadev
      @merzadev 3 місяці тому

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

  • @aminghasemi2621
    @aminghasemi2621 4 місяці тому +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.

  • @user-xq8jq2ex8y
    @user-xq8jq2ex8y 3 місяці тому

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

  • @tofaelahmed8255
    @tofaelahmed8255 4 місяці тому

    Plz give us a tutorial about asynchronous JavaScript

  • @muhammadayazfaisal6786
    @muhammadayazfaisal6786 4 місяці тому

    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.

  • @user-zc1xh4sj7n
    @user-zc1xh4sj7n 4 місяці тому

    Dang, u really know what your fans want

  • @user-cg4ft5op9w
    @user-cg4ft5op9w 3 місяці тому

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

  • @salamesalehpour
    @salamesalehpour 3 місяці тому

    دمت گرم

  • @adityapatil4287
    @adityapatil4287 4 місяці тому

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

  • @noorsajee7376
    @noorsajee7376 2 місяці тому

    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

  • @gd6noob
    @gd6noob 4 місяці тому

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

  • @LearnwithSSRK
    @LearnwithSSRK 3 місяці тому

    Pls upload JavaScript full tutorial video

  • @nicolasm.bronner2747
    @nicolasm.bronner2747 Місяць тому

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

  • @SabonaMarara
    @SabonaMarara 4 місяці тому

    please i need full course thanks

  • @minimalsforlife740
    @minimalsforlife740 4 місяці тому

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

  • @ishimweisaac1019
    @ishimweisaac1019 4 місяці тому

    This 40 mins was worth watching

  • @agatanor
    @agatanor 4 місяці тому

    do you recommend vue js or react for beginners?

    • @_rachid
      @_rachid 4 місяці тому

      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 4 місяці тому

      react next

  • @fatokihabeeb4254
    @fatokihabeeb4254 3 місяці тому

    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.

  • @ayushmangarg2
    @ayushmangarg2 4 місяці тому

    Please make a AIML course please

  • @user-ze5ou8se6i
    @user-ze5ou8se6i 4 місяці тому

    Flutter course would be a killer

  • @mryasinize
    @mryasinize 4 місяці тому

    But Mosh, how can I write tests for tests?

  • @user-cg4ft5op9w
    @user-cg4ft5op9w 3 місяці тому

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

  • @tomu_sange
    @tomu_sange 4 місяці тому

    I think this course is mine.

  • @raghavenderkuppireddy7158
    @raghavenderkuppireddy7158 4 місяці тому

    ❤❤❤❤❤❤

  • @deatho0ne587
    @deatho0ne587 4 місяці тому

    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.

  • @neciyvavian5223
    @neciyvavian5223 3 місяці тому

    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😢

  • @ojomudamola6674
    @ojomudamola6674 3 місяці тому

    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

  • @aryanmangi9707
    @aryanmangi9707 3 місяці тому

    Hey mosh let's talk business

  • @flywithoutwingss
    @flywithoutwingss 2 місяці тому

    I just missed the early price 😅

  • @rafeeqshaik7355
    @rafeeqshaik7355 4 місяці тому

    Micro services course using nodejs. 😢😢

  • @sen86sen
    @sen86sen 3 дні тому

    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...

  • @s.joseph4838
    @s.joseph4838 4 місяці тому

    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 3 місяці тому

    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.