We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have no idea how hard it would be, but it would be nice to write an assert like this:
or in the .bru file:
.bru
... assert { res.body: isArray res.body[*]: isString res.body[*]: isNotEmpty }
The idea is to check that all values in an array are strings, just with assertions. Or any of the other operators which currently exist.
Responses which would pass would be:
[] ["abc"] ["abc", "def"]
Responses which wouldn't pass would be:
["abc", 123] [123] [null] [{}]
The edge-case when the array is empty should always pass, since one can simply add another assertion that the array is not empty.
For simple arrays:
... assert { res.body[*]: isString }
Nice-to-have would be further nesting like res.body[*][*] or res.body[*].values[*]
res.body[*][*]
res.body[*].values[*]
The error message for a fail could be the first value which failed, or something similar.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have checked the following:
Describe the feature you want to add
I have no idea how hard it would be, but it would be nice to write an assert like this:
or in the
.bru
file:The idea is to check that all values in an array are strings, just with assertions. Or any of the other operators which currently exist.
Responses which would pass would be:
Responses which wouldn't pass would be:
The edge-case when the array is empty should always pass, since one can simply add another assertion that the array is not empty.
Mockups or Images of the feature
For simple arrays:
or in the
.bru
file:Nice-to-have would be further nesting like
res.body[*][*]
orres.body[*].values[*]
The error message for a fail could be the first value which failed, or something similar.
The text was updated successfully, but these errors were encountered: