# mocha-itcase

> a test case function for mocha

Latest version **0.0.3** (published 2017-01-20) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install mocha-itcase
pnpm add mocha-itcase
yarn add mocha-itcase
bun add mocha-itcase
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-01-20 |
| First published | 2017-01-09 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | James M Pierce |
| Maintainers | jtuesday |
| Keywords | mocha, it, test |

## Links

- npm: https://www.npmjs.com/package/mocha-itcase
- Repository: https://github.com/mrjpierce/mocha-itcase
- Homepage: https://github.com/mrjpierce/mocha-itcase#readme
- Issues: https://github.com/mrjpierce/mocha-itcase/issues
- npm.io page: https://npm.io/package/mocha-itcase

## Dependencies (1)

- [mocha](https://npm.io/package/mocha.md) ^3.2.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2017-01-20
- 0.0.2 — 2017-01-20
- 0.0.1 — 2017-01-09

## README

# mocha-itcase
A mocha extension for multiple test cases for the same test

## Install
```
npm install mocha
npm install mocha-itcase
```

## Usage

Javascript
``` js
const itCase = require('mocha-itcase');

function Add(a, b) {
    return a + b;
}

itCase('should add numbers correctly', [
    { input1: 2, input2: 2, expected: 4 },
    { input1: 3, input2: 3, expected: 6 },
    { input1: 4, input2: 4, expected: 8 }
], (input1, input2, expected) => {
    let result = Add(input1, input2);
    assert(result === expeccted);
});

```
```
Output:
    √ should add numbers correctly (2, 2, 4)
    √ should add numbers correctly (3, 3, 6)
    √ should add numbers correctly (4, 4, 8)

  3 passing (51ms)
```


Alternate Typescript import, declaration file included
``` ts
import itCase from 'mocha-itcase';
```

---
_Source: https://npm.io/package/mocha-itcase · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
