You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.
It would be great if there was a function on the like in Laravel that allows you to verify the structure of the JSON response rather than specific value as in all case you might not be interested what really in the data want to be sure that it is present.
e.g. response.assertJSONStructure([ 'bearer', 'token', 'refreshToken ]);
Why this feature is required (specific use-cases will be appreciated)?
It's very much a nice to have. However in my case I am testing a sort of register user endpoint and expect back the auth object. I would like to verify that the token is part of the response but I generally don't care what the actual value is.
Have you tried any other work arounds?
This seems to do the job however it's not particularly clear to read. assert.containsAllKeys(response.body, ['token'])
Are you willing to work on it with little guidance?
yes
The text was updated successfully, but these errors were encountered:
It would be great if there was a function on the like in Laravel that allows you to verify the structure of the JSON response rather than specific value as in all case you might not be interested what really in the data want to be sure that it is present.
e.g.
response.assertJSONStructure([ 'bearer', 'token', 'refreshToken ]);
Why this feature is required (specific use-cases will be appreciated)?
It's very much a nice to have. However in my case I am testing a sort of register user endpoint and expect back the auth object. I would like to verify that the token is part of the response but I generally don't care what the actual value is.
Have you tried any other work arounds?
This seems to do the job however it's not particularly clear to read.
assert.containsAllKeys(response.body, ['token'])
Are you willing to work on it with little guidance?
yes
The text was updated successfully, but these errors were encountered: