Problem
From time to time, I run into a situation, where most of my test cases follow a similar sequence of steps. This scenario most of...
For further actions, you may consider blocking this person and/or reporting abuse
Great article on simplifying Jest test cases! It's always helpful to explore different approaches to streamline testing processes. Speaking of testing, I recently came across a comprehensive guide on running Jest Testing with Selenium and JavaScript. It covers everything from setup to execution and provides valuable insights. If anyone is interested in expanding their testing capabilities, I highly recommend checking it out. how to run Jest Testing with Selenium and JavaScript Keep up the excellent content!"
Hey I really liked this example.
Is there a way to make something similar but the difference would be in 1 test the element is in the document and the other test the element is NOT in the document.
I kinda have an idea but I think what I thought is too much abstraction and unnecesary.
This was just a nice article.Thanks so much Gordon
Thank you, so much easier to understand then in the docs!
Any idea of how to use just the second argument in the text?
"given %p and %p as arguments, returns %p",
You'll have to use both of them, but the convention is if you're not using a parameter you should name it a single underscore _
What is the benefit of using the test.each of jest instead of js for each? I think it is more readable and friendly the js way
Using test.each will create one test for each test case, so if it fails, you will know exactly which test case failed. It will also run the rest of the test cases even if one failed.
If you use for each, then your entire test will fail on the first case failure, and you will not know which one failed quickly.
That's not completely true. You can put an
it
inside a forEach loop and get the same behavior.this is exactly what I needed. tnx for the article
How do you deal with cases where you have over 100,000 possible combinations you want to test out?
Thanks. Simple use case helped grasp the concept quickly.
Really nice solution. Thanks.
Thank you, this article is so much simple to understand
thanks. this was helpful
Thank-you! I'm just beginning to implement tests today, I've known about them for years, but only dabbled. And finally now I have a use! And a great tutorial thanks to you.