JavaScript Unit Testing Tutorial for Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ก.ค. 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

ความคิดเห็น • 110

  • @programmingwithmosh
    @programmingwithmosh  3 หลายเดือนก่อน +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 2 หลายเดือนก่อน

      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?

    • @pykenga
      @pykenga หลายเดือนก่อน

      no

  • @invertedcoder
    @invertedcoder 5 หลายเดือนก่อน +18

    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 5 หลายเดือนก่อน +4

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

  • @amirhoseinshams256
    @amirhoseinshams256 5 หลายเดือนก่อน +2

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

  • @anotherhumanLingLing
    @anotherhumanLingLing หลายเดือนก่อน

    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!

  • @monkamkelvin9115
    @monkamkelvin9115 5 หลายเดือนก่อน +40

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

    • @rafeeqshaik7355
      @rafeeqshaik7355 5 หลายเดือนก่อน +2

      Me too broo

    • @ademineshat
      @ademineshat 5 หลายเดือนก่อน +2

      Me tooo 😅 Let's Blow up this comment 🎉

    • @kristapsg3540
      @kristapsg3540 5 หลายเดือนก่อน +1

      Me too!

    • @khaled.noordin
      @khaled.noordin 5 หลายเดือนก่อน

      Flutter sukcs better focus on fp-ts lib.

    • @programmingwithdami
      @programmingwithdami 5 หลายเดือนก่อน

      No he didn't

  • @lorenainfanter.3099
    @lorenainfanter.3099 3 หลายเดือนก่อน

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

  • @harshbansal
    @harshbansal 5 หลายเดือนก่อน +1

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

  • @georgezzz55
    @georgezzz55 5 หลายเดือนก่อน

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

  • @cppexplorery
    @cppexplorery 4 หลายเดือนก่อน +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 💪

  • @abdelalikabou9197
    @abdelalikabou9197 5 หลายเดือนก่อน

    Thank you so much mosh . Still learning from you 😉

  • @kevinemugisha9035
    @kevinemugisha9035 5 หลายเดือนก่อน

    Thanks Mosh, we love youuuuu

  • @inspirechristians5789
    @inspirechristians5789 5 หลายเดือนก่อน

    Mosh you are my model to be inspired

  • @user-tx5yi7bk2r
    @user-tx5yi7bk2r 4 หลายเดือนก่อน

    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 5 หลายเดือนก่อน

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

  • @bmarecords5183
    @bmarecords5183 5 หลายเดือนก่อน

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

  • @russellmoore3418
    @russellmoore3418 4 หลายเดือนก่อน

    Excellent video, very well done!

  • @Whisperywolf1269
    @Whisperywolf1269 5 หลายเดือนก่อน

    best course ever

  • @gfabasic32
    @gfabasic32 4 หลายเดือนก่อน

    Thanks Mosh!

  • @kipfitpal
    @kipfitpal 5 หลายเดือนก่อน

    Yay, Mosh is back !!!!

  • @Omar-jibril
    @Omar-jibril 5 หลายเดือนก่อน

    Thanks Mosh

  • @mehmetaydar_QXyGeN
    @mehmetaydar_QXyGeN 5 หลายเดือนก่อน

    Thank you so much :)

  • @valeriaguzman9620
    @valeriaguzman9620 5 หลายเดือนก่อน

    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 5 หลายเดือนก่อน

      What does your work mostly consists of ?

  • @lebogangsekwati4305
    @lebogangsekwati4305 5 หลายเดือนก่อน

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

  • @ar-swe
    @ar-swe 5 หลายเดือนก่อน

    love you mosh

  • @shashankphatkure
    @shashankphatkure 4 หลายเดือนก่อน

    thankyou very much sir :)

  • @hosseinjafari2896
    @hosseinjafari2896 2 หลายเดือนก่อน

    You're doing amazing.
    Love from Iran😍

  • @chandrashekharreddy5380
    @chandrashekharreddy5380 5 หลายเดือนก่อน +2

    Ur just awesome

  • @reza-bx8em
    @reza-bx8em 5 หลายเดือนก่อน

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

  • @MohammadMansourBone
    @MohammadMansourBone 5 หลายเดือนก่อน +4

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

  • @monkamkelvin9115
    @monkamkelvin9115 5 หลายเดือนก่อน +3

    Mosh please your flutter course

  • @mehakgrover2174
    @mehakgrover2174 5 หลายเดือนก่อน

    Hi Mosh

  • @betterstack
    @betterstack 4 หลายเดือนก่อน

    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 💪

  • @davood7497
    @davood7497 5 หลายเดือนก่อน

    Mosh is back 💯💯💯

  • @user-lb2pl9qi6w
    @user-lb2pl9qi6w 5 หลายเดือนก่อน

    Waiting ❤

  • @TroyTV5
    @TroyTV5 3 หลายเดือนก่อน

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

  • @balakrishnaprasad8928
    @balakrishnaprasad8928 5 หลายเดือนก่อน

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

  • @techsolutions4652
    @techsolutions4652 5 หลายเดือนก่อน

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

  • @JunaidKhan-hy5rr
    @JunaidKhan-hy5rr 5 หลายเดือนก่อน +1

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

  • @tsnaw8173
    @tsnaw8173 5 หลายเดือนก่อน +1

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

  • @ashikahmedfahim232
    @ashikahmedfahim232 5 หลายเดือนก่อน +2

    Flutter course please

  • @minimalsforlife740
    @minimalsforlife740 5 หลายเดือนก่อน

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

  • @Bunny_Video1
    @Bunny_Video1 5 หลายเดือนก่อน

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

  • @iffalcontcl6738
    @iffalcontcl6738 5 หลายเดือนก่อน

    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.

  • @anasouardini
    @anasouardini 5 หลายเดือนก่อน

    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.

  • @SRTIEP
    @SRTIEP 4 หลายเดือนก่อน +1

    Flutter Mosh Please ❤

  • @athulliapaulose
    @athulliapaulose 5 หลายเดือนก่อน

    Waiting for the react testing course ❤

  • @davidalejandrollanesbojorq63
    @davidalejandrollanesbojorq63 หลายเดือนก่อน

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

  • @salamesalehpour
    @salamesalehpour 5 หลายเดือนก่อน

    دمت گرم

  • @AbhishekGupta-ji4pf
    @AbhishekGupta-ji4pf 5 หลายเดือนก่อน

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

  • @malikarandolph8187
    @malikarandolph8187 5 หลายเดือนก่อน

    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?

    • @hk254lyt8
      @hk254lyt8 4 หลายเดือนก่อน

      JavaScript

  • @abdullaalfaiyaz1890
    @abdullaalfaiyaz1890 5 หลายเดือนก่อน

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

  • @ghaatol
    @ghaatol 5 หลายเดือนก่อน

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

  • @LokeshKumar-tk7ri
    @LokeshKumar-tk7ri 5 หลายเดือนก่อน +2

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

    • @merzadev
      @merzadev 5 หลายเดือนก่อน

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

  • @sina127458
    @sina127458 5 หลายเดือนก่อน

    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?

  • @muhammadayazfaisal6786
    @muhammadayazfaisal6786 5 หลายเดือนก่อน

    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-xq8jq2ex8y
    @user-xq8jq2ex8y 5 หลายเดือนก่อน

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

  • @tofaelahmed8255
    @tofaelahmed8255 5 หลายเดือนก่อน

    Plz give us a tutorial about asynchronous JavaScript

  • @abzz1290
    @abzz1290 4 หลายเดือนก่อน

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

  • @Bhushantbn
    @Bhushantbn 5 หลายเดือนก่อน

    Which vs code theme you used??

  • @user-zc1xh4sj7n
    @user-zc1xh4sj7n 5 หลายเดือนก่อน

    Dang, u really know what your fans want

  • @aminghasemi2621
    @aminghasemi2621 5 หลายเดือนก่อน +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.

    • @programmingwithmosh
      @programmingwithmosh  5 หลายเดือนก่อน +1

      Great suggestion!

    • @alfurquanzahedi8338
      @alfurquanzahedi8338 5 หลายเดือนก่อน

      @programmingwithmosh can you please make a course on system design

  • @minimalsforlife740
    @minimalsforlife740 5 หลายเดือนก่อน

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

  • @LearnwithSSRK
    @LearnwithSSRK 4 หลายเดือนก่อน

    Pls upload JavaScript full tutorial video

  • @user-ze5ou8se6i
    @user-ze5ou8se6i 5 หลายเดือนก่อน

    Flutter course would be a killer

  • @ayushmangarg2
    @ayushmangarg2 5 หลายเดือนก่อน

    Please make a AIML course please

  • @SabonaMarara
    @SabonaMarara 5 หลายเดือนก่อน

    please i need full course thanks

  • @user-cg4ft5op9w
    @user-cg4ft5op9w 5 หลายเดือนก่อน

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

  • @ishimweisaac1019
    @ishimweisaac1019 5 หลายเดือนก่อน

    This 40 mins was worth watching

  • @adityapatil4287
    @adityapatil4287 5 หลายเดือนก่อน

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

  • @gd6noob
    @gd6noob 5 หลายเดือนก่อน

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

  • @raghavenderkuppireddy7158
    @raghavenderkuppireddy7158 5 หลายเดือนก่อน

    ❤❤❤❤❤❤

  • @agatanor
    @agatanor 5 หลายเดือนก่อน

    do you recommend vue js or react for beginners?

    • @_rachid
      @_rachid 5 หลายเดือนก่อน

      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 5 หลายเดือนก่อน

      react next

  • @mryasinize
    @mryasinize 5 หลายเดือนก่อน

    But Mosh, how can I write tests for tests?

  • @fatokihabeeb4254
    @fatokihabeeb4254 5 หลายเดือนก่อน

    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.

  • @nicolasm.bronner2747
    @nicolasm.bronner2747 3 หลายเดือนก่อน

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

  • @tomu_sange
    @tomu_sange 5 หลายเดือนก่อน

    I think this course is mine.

  • @user-cg4ft5op9w
    @user-cg4ft5op9w 5 หลายเดือนก่อน

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

  • @noorsajee7376
    @noorsajee7376 4 หลายเดือนก่อน

    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

  • @rafeeqshaik7355
    @rafeeqshaik7355 5 หลายเดือนก่อน

    Micro services course using nodejs. 😢😢

  • @deatho0ne587
    @deatho0ne587 5 หลายเดือนก่อน

    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.

    • @programmingwithmosh
      @programmingwithmosh  5 หลายเดือนก่อน

      I’ve covered those in the full course.

  • @ojomudamola6674
    @ojomudamola6674 4 หลายเดือนก่อน

    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

  • @flywithoutwingss
    @flywithoutwingss 4 หลายเดือนก่อน

    I just missed the early price 😅

  • @neciyvavian5223
    @neciyvavian5223 4 หลายเดือนก่อน

    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😢

  • @aryanmangi9707
    @aryanmangi9707 5 หลายเดือนก่อน

    Hey mosh let's talk business

  • @sen86sen
    @sen86sen หลายเดือนก่อน

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

  • @mainulhasanrifat
    @mainulhasanrifat 14 วันที่ผ่านมา

    you talk much about what you will do and actually does less.

  • @aammssaamm
    @aammssaamm หลายเดือนก่อน

    Waste of time. This is not for beginners, this is for illiterates.

  • @s.joseph4838
    @s.joseph4838 5 หลายเดือนก่อน

    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 5 หลายเดือนก่อน

    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.