1.1.5 • Published 6 years ago

mocha-where v1.1.5

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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);
    });

});
1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago