lundi 26 octobre 2015

How to step out of testing loop after one fail

How to exit loop test after one expect fail?

it('full range check sec should return reverse result', inject(function ($filter) {

      for(var i=0;i<100000;i+=60*50)
      {
        var result = $filter('sec2h')(i);
        var sign = result.substr(result.length-1);

        expect(sign).toEqual("h");

        var reversed_result = result.substr(0, result.length-1);
        reversed_result = reversed_result * 60 * 60;

        expect(reversed_result).toEqual(i);
      }
    }));

Aucun commentaire:

Enregistrer un commentaire