vitest-cucumber
vitest-cucumber copied to clipboard
Guide on creating idompotent tests using React Testing library
With only a few months under my belt with BDD/TDD, I am still learning how to structure these tests to be valid and isolated from each other.
With the Feature/Scenario hierarchy, I am still figuring out how to test unique capabilities (scenarios) of a component (feature) within the same test file without having overlap between scenarios.
For example, when testing a search bar, I type abc
and then check for results. In the next scenario, I would type def
. However, I am having an issue where it does not reset the previous scenario and I get abcdef
in the search bar. I ham including Before/AfterEachScenario
hooks, but it would be nice to have some sort of auto reset if we are using the React Testing Library render method
I will continue developing and possibly make a template repo for this if I figure it out.