Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "data": [
- {
- "id": "123",
- "type": "something",
- "created": "1540952074",
- "test": [
- {
- "key1": "asd123",
- "key2": "166802"
- }
- ]
- },
- pm.test('returns the correct parameters by type', () => {
- for (i = 0; i < jsonData.data.length; i++) {
- if (jsonData.data[i].type === 'something') {
- // for (j = 0; j < jsonData.data.test.length; j++) {
- pm.expect(jsonData.data[i]).to.have.property('id');
- pm.expect(jsonData.data[i]).to.have.property('type');
- pm.expect(jsonData.data[i]).to.have.property('created');
- pm.expect(jsonData.data[i].test[0]).to.have.property('key1');
- pm.expect(jsonData.data[i].test[0]).to.have.property("key2");
- }
- returns the correct parameters by type | TypeError: Cannot read property '0' of undefined
- Object:{}
- key1:"asd123"
- key2:"166802"
Add Comment
Please, Sign In to add comment