Based on Neckbeard.js
Allows BDD style looping in your jasmine specifications.
you can loop with one variable
loop2 = jparams.iterate('num').values(1,2,3,4);
or with multiple variables
loop = jparams
.iterate('first', 'second', 'expected')
.values([3, 3, 6],
[10, 4, 14],
[7, 1, 8]);
loop.it('runs for number #num', function(num){
expect(num).toBeGreaterThan(0);
});
or for multiple values
loop.it('#first + #second should be #expected', function(first, second, expected){
expect(first + second).toBe(expected);
});
If the passed function has one argument more than defined in the iterate
, the last argument will be
used to pass the done
value. See the spec
for an example.
- it
- iit
- xit
- describe
- ddescribe
- xdescribe