mocha-where
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i mocha-where

Weekly Downloads

0

Version

1.1.5

License

MIT

Unpacked Size

6.66 kB

Total Files

9

Last publish

Collaborators

  • tachyon5k