mercredi 27 mai 2015

POSTMAN jetpacks TESTING within for loop

Hitting API w/ GET request, checking if item has been deleted by globals.id variable, have test inside forloop and when I run test returns 0/0 tests passed. All of my console logs within the for loop work, the objects contain values matching what I have as well. Anyone know how to do this?

var data = JSON.parse(responseBody);


for (var i = 0; i < data.length; i++){
  tests["id has been deleted"] = data[i].id !== globals.id;
  if(data[i].id !== globalID){
    tests["id has been deleted"] = data[i].id !== globals.id;
    return true;
  }
}

Aucun commentaire:

Enregistrer un commentaire