You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found an issue that is bugging me a bit. I've seen it happen twice now on our team.
If someone creates a new unroll test or converts an existing single test to unroll, and they somehow forget to wrap the args in an array, the tests will not execute. Normally, this would be caught. But, in a sufficiently large codebase it could be missed (it has in our case).
It would be great if there was a way to make unroll (or even lint?) complain if it sees a test with args that are not wrapped in an array.
Wrong way this test won't execute
describe('maximum of two numbers (unrolled)', function() {
unroll('maximum of #a and #b is #c',
function(done, testArgs) {
expect(
Math.max(testArgs['a'], testArgs['b'])
).to.be.equal(testArgs['c']);
done();
},
['a', 'b', 'c'],
[ 3, 5, 5 ],
[ 7, 0, 7 ]
);
});
Correct way: this test will execute
describe('maximum of two numbers (unrolled)', function() {
unroll('maximum of #a and #b is #c',
function(done, testArgs) {
expect(
Math.max(testArgs['a'], testArgs['b'])
).to.be.equal(testArgs['c']);
done();
},
[
['a', 'b', 'c'],
[ 3, 5, 5 ],
[ 7, 0, 7 ]
]
);
});
The text was updated successfully, but these errors were encountered:
I've found an issue that is bugging me a bit. I've seen it happen twice now on our team.
If someone creates a new unroll test or converts an existing single test to unroll, and they somehow forget to wrap the args in an array, the tests will not execute. Normally, this would be caught. But, in a sufficiently large codebase it could be missed (it has in our case).
It would be great if there was a way to make unroll (or even lint?) complain if it sees a test with args that are not wrapped in an array.
Wrong way this test won't execute
Correct way: this test will execute
The text was updated successfully, but these errors were encountered: