TDD in JavaScript | Test Driven Development

Поделиться
HTML-код
  • Опубликовано: 9 сен 2024
  • Learn how to use test-driven development (TDD) in your JavaScript applications to help guide your software development.
    🔗Code:
    github.com/Sam...
    🔗Moar Links
    My Website: www.sammeechwa...
    Instagram: / meech_ward
    Github: github.com/org...

Комментарии • 28

  • @JJP-lb3ek
    @JJP-lb3ek 3 года назад +10

    I think its worth mentioning in these type of videos, that a huge advantage of TDD is that you are making a sort of checklist about what it is that you want your software to do. These "checklists" help me know what the next step will be, and I dont feel as lost as before.

  • @ericschmidt6129
    @ericschmidt6129 3 года назад +2

    A very good introduction to TDD. I just started using TDD a month or so ago and I found this to be a helpful description of the process.

  • @sarabwt
    @sarabwt 3 года назад +4

    I might be really nit picky, but you never want to write a test that passes because you cannot be sure that it is testing anything. That is the sole purpose of red, green, refactor - to confirm that the code you wrote actually had an effect on a test. Also, you would be better off if you delayed the happy case until the very end, because even in your example the happy case test passed, but the implementation was completely wrong, making the test useless at that point. Anyways, really enjoyed the video, keep it up :D

    • @SamMeechWard
      @SamMeechWard  3 года назад +5

      Be very very very careful of absolute statements like that when it comes to programming. red, green, refactor is a guide; not the absolute rule.
      It's fine to write a test that passes, you need to make sure you have a "sufficient" number of tests and sometimes a test will pass already. This is not a bad thing. It does make it a little bit more difficult to know if the test is accurate, but not impossible. Also the test won't have to change so the test is still very useful for to achieve the end result.

  • @arbinshrestha
    @arbinshrestha 2 года назад

    you know just how much sense this just makes

  • @RioKnightley
    @RioKnightley 3 месяца назад

    Best TDD video i've seen so far nice one

  • @user-nl8wi2cg9x
    @user-nl8wi2cg9x 6 месяцев назад

    A very good introduction to TDD. SIMPLE

  • @natewalchenbach8413
    @natewalchenbach8413 Год назад

    Everything was very well laid out! Thank you for this great content!

  • @mathieupbourgeoismat4330
    @mathieupbourgeoismat4330 3 года назад +4

    Great content! It would be awesome to have something similar for frontend TDD (react, angular, vuejs; whichever)

  • @AwesomeEnterpriseInc
    @AwesomeEnterpriseInc 3 года назад +1

    Killing it! What's up next? before/beforeEach? Or what it is that's actually making the test fail (an error being thrown)?

  • @anaskhan9977
    @anaskhan9977 3 года назад

    thanks sam. you are a saviour

  • @DuyTran-ss4lu
    @DuyTran-ss4lu 2 года назад +1

    Cool

  • @Mari_Selalu_Berbuat_Kebaikan
    @Mari_Selalu_Berbuat_Kebaikan 2 месяца назад

    Let's always do alot of good

  • @yogesh-yadav
    @yogesh-yadav 3 года назад +1

    superb

  • @tech3425
    @tech3425 Год назад

    Thanks for this vid

  • @aprilm2941
    @aprilm2941 3 года назад +1

    🥰🤗

  • @leandrogehlen5621
    @leandrogehlen5621 Год назад

    I'm starting with TDD now.I might be wrong, but seems to me that TDD is better done with OOP them functional.Because of the clean archtecture and SOLID principals and the resulting design.What do you think about that?
    🖖🙏

  • @brhoom.h
    @brhoom.h 3 месяца назад

    I have questions! when I use TDD with the express, should I test my endpoints API with the password validation? or should testing APIs be the last thing I should do before making the app in production?

  • @adriocoder9192
    @adriocoder9192 2 года назад

    awesome

  • @sammygopeh7578
    @sammygopeh7578 Год назад

    Again, THANK YOOOOOOOUUUUU!!!

  • @jacobthedev4979
    @jacobthedev4979 Год назад

    Great video!

  • @stevensidhu8368
    @stevensidhu8368 3 года назад

    Quality Content 🤗

  • @leanne333
    @leanne333 3 года назад

    🤗🤗🤗🤗

  • @jonydude
    @jonydude 3 года назад

    Very new to TDD, so forgive the rookie question.
    I’m working very closely with HTML and CSS, so often what I want to test is “does this look right?”
    Even down in the JavaScript level, i often find myself pressed to describe what my desired output is, but I’ll know it when I see it.
    Is there a way to get the test outputs to appear in the browser so I can physically see that yes that’s the output I want, before writing the function that will produce it?
    I really want to get into TDD, but manipulating html, I fear the tests will be harder to write than the code.

    • @AlbertoPNeto
      @AlbertoPNeto 3 года назад

      I do not know if you've found your answer yet, but yes, you can. You want a frontend test. This frontend test could be an integration test, for example, you render just a single component and validate the content visible.
      There is also a technique that snapshots your screen (let's say at the end of a test) and then compares it to a previous snapshot. These, I think, would usually be used along a e2e test.
      You could use jest on your unit test, and cypress on your e2e testing