mardi 21 juin 2016

Jasmine 2 Spec has no expectations

I have the following test:

describe('when invoked', function() {
  it('should check something', function() {
    _.each(someData, function(obj, index) {
      expect(obj[index].lable).toBe('foo');
    });
  });
});

When I run Jasmine 2.2.0 it get the following error:

Spec 'SpecLabel function when invoked return value should check something' has no expectations.

Am I missing something? In Jasmin 1.x we could do this. Have expect inside a for each, or even a for loop.

How can I fix these type of tests? And what are the docs for these situations? The Jasmine website is not really helpful.

Aucun commentaire:

Enregistrer un commentaire