Nesting/grouping tests? #441
Unanswered
ajthinking
asked this question in
Q&A
Replies: 1 comment
-
You can use data providers with these variations. beforeEach(function () {
// Add/load your data fixtures for resources (1, 2, 3, ...) and users that owns it...
});
it('gets a resource', function (int $id, string $username, int $expectedStatusCode) {
// Authenticate request with $username...
// Add expectations for request and response status code
})
->with([
'existing resource (1)' => [1, 'user1', 200],
'unexisting resource (3)' => [3, 'user1', 404],
'resource 2 is not owned by user2' => [2, 'user2', 403],
])
; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using rspec I can do things like:
This can be useful when having tons of variations to test. Can I do something similar with pest? If not, could/do we want to add something similar?
Thanks for making this beautiful thing 🥳
Beta Was this translation helpful? Give feedback.
All reactions