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
I am getting an error when I try to validate a key:value pair of an object that is in an array. I am wondering if this is possible and if so, is there an example?
Here is a snippet of the JSON response that I am testing (I want to test for a valid namespace and name inside the name objects:
describe('integration tests', function() {
it('test response', function (done) {
frisby
.timeout(timeoutSeconds)
.get(someURL)
.expect('status', 200)
.expect('header','content-type', 'application/json;charset=UTF-8')
.expect('json', 'EntityDirectory.entry.?', {
about: 'some value:A0001'
})
.expect('json', 'EntityDirectory.entry.*.name', { // <--- this is the line in question
namespace: 'Automobiles',
name: 'GM'
})
.done(done);
}, timeoutSeconds);
});
Here is the error:
F.......(node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): AssertionError: Response [ {"namespace":"Automobiles","name":"GM"} ] does not contain provided JSON [ {"namespace":"Automobiles","name":"A0001"} ]
I am using frisby version 2.0.11.
Is there a way to test the values of the namespace and name for each object in the entry array?
The text was updated successfully, but these errors were encountered:
I am getting an error when I try to validate a key:value pair of an object that is in an array. I am wondering if this is possible and if so, is there an example?
Here is a snippet of the JSON response that I am testing (I want to test for a valid namespace and name inside the name objects:
Here is my Frisby test:
Here is the error:
F.......(node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): AssertionError: Response [ {"namespace":"Automobiles","name":"GM"} ] does not contain provided JSON [ {"namespace":"Automobiles","name":"A0001"} ]
I am using frisby version 2.0.11.
Is there a way to test the values of the namespace and name for each object in the entry array?
The text was updated successfully, but these errors were encountered: