Test hierarchy with Contexts/Scopes #529
thiagovictorino
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was looking into Pest and its documentation, then I miss a very nice feature.
Summary
Create a feature where it is possible to create contexts inside tests and inside other contexts to apply the idea of test hierarchy, like scoping in Jest and Context in RSpec to run scoped setUp and tearDowns
Example
Let's think about the scenario:
My suggestion is the test be something like
I know that I am not using the same architecture as Pest. I am just trying to show my idea.
Why I think it is good to have
Well, when we have a significant setups functions, it can be a problem because sometimes you don't need to run all the functions inside beforeAll or beforeEach, but only when some tests run.
I saw one discussion posted that didn't point out the idea so profoundly.
Beta Was this translation helpful? Give feedback.
All reactions