mocha-where
v1.1.5
Published
Parameteration for mocha tests
Downloads
1,433
Readme
mocha-where
Parameteration for Mocha tests.
Usage
import {where} from "mocha-where";
where([
['first', 'second', 'expected'],
[1, 2, 3 ]
])
.it("#first plus #second equals #expected", (scenario) => {
expect(scenario.first + scenario.second).to.equal(scenario.expected);
});
const add = (a: number, b: number) => a + b;
const exponent = (a: number, b: number) => Math.pow(a,b);
where([
['name', 'subject'],
['add()', add ],
['exponent()', exponent ]
])
.describe('#name', (scenario) => {
it('when given 2 and 2 returns 4', () => {
expect(scenario.subject(2, 2)).to.equal(4);
});
});