92
rated 0 times
[
96]
[
4]
/ answers: 1 / hits: 17986
/ 6 Years ago, tue, february 13, 2018, 12:00:00
How do I check that the data type of each value in an API response is NOT an integer?
For example, if my API returns this:
teamPermissions: [
Edit,
Administrator,
ReadOnly,
etc
]
I need a Postman test to make sure that an integer is never returned in the teamPermission
array.
Here's what I started but need assistance:
var jsonData = JSON.parse(responseBody);
tests[Team Permissions Do Not Contain Integers] = typeof(jsonData.teamPermissions) !== number
This passes because teamPermissions
is an object but how do I check each value of the object is not an integer?
More From » postman