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...
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.
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.
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
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.
you know just how much sense this just makes
Best TDD video i've seen so far nice one
A very good introduction to TDD. SIMPLE
Everything was very well laid out! Thank you for this great content!
Great content! It would be awesome to have something similar for frontend TDD (react, angular, vuejs; whichever)
Killing it! What's up next? before/beforeEach? Or what it is that's actually making the test fail (an error being thrown)?
thanks sam. you are a saviour
Cool
Let's always do alot of good
superb
Thanks for this vid
🥰🤗
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?
🖖🙏
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?
awesome
Again, THANK YOOOOOOOUUUUU!!!
🤗
Great video!
Quality Content 🤗
🤗🤗🤗🤗
🤗
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.
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