Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Parametrized test with Mocha example
describe('Something', function() {
var values = ['a', 'b', 'c'];
values.forEach(function(val) {
it('should do something with ' + val + ' in this test', function() {
assert.equal(foo(), val);
});
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment