# @types/mocha-each

> TypeScript definitions for mocha-each

Latest version **2.0.4** (published 2023-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/mocha-each
pnpm add @types/mocha-each
yarn add @types/mocha-each
bun add @types/mocha-each
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2023-11-21 |
| First published | 2018-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51437 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/mocha-each
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mocha-each
- npm.io page: https://npm.io/package/@types/mocha-each

## Dependencies (1)

- [@types/mocha](https://npm.io/package/@types/mocha.md) *

## Recent versions

- 2.0.4 (latest) — 2023-11-21
- 2.0.0 (ts2.8) — 2020-02-12
- 1.1.0 (ts2.1) — 2018-02-18
- 2.0.3 — 2023-11-07
- 2.0.2 — 2023-10-18
- 2.0.1 — 2023-09-27

## README

# Installation
> `npm install --save @types/mocha-each`

# Summary
This package contains type definitions for mocha-each (https://github.com/ryym/mocha-each#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mocha-each.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mocha-each/index.d.ts)
````ts
import { Context, Suite, SuiteFunction, Test, TestFunction } from "mocha";

/**
 * This function takes an array collections of parameters to be used in
 * a series of mocha tests, defined using the `it` or `describe` notation common to
 * Mocha.
 */
declare function forEach(
    parameters: readonly any[],
    dIt?: TestFunction,
    dDescribe?: SuiteFunction,
): { it: ForEachTestFunction; describe: ForEachDescribeDefinition };

/**
 * This interface describes the kind of `it` available from a `forEach` call.
 * The result is very similar to Mocha's `TestFunction` interface.
 */
interface ForEachTestFunction {
    (expectation: string, callback?: (this: Context, ...args: any[]) => any): Test;
    only(expectation: string, callback?: (this: Context, ...args: any[]) => any): Test;
    skip(expectation: string, callback?: (this: Context, ...args: any[]) => any): Test;
}

/**
 * This interface describes the kind of `describe` available from a `forEach` call.
 * The result is almost identical to Mocha's `SuiteFunction` interface.
 */
interface ForEachDescribeDefinition {
    (expectation: string, callback?: (this: Context, ...args: any[]) => any): Suite;
    only(expectation: string, callback?: (this: Context, ...args: any[]) => any): Suite;
    skip(expectation: string, callback?: (this: Context, ...args: any[]) => any): Suite;
}

export = forEach;

````

### Additional Details
 * Last updated: Mon, 20 Nov 2023 23:36:24 GMT
 * Dependencies: [@types/mocha](https://npmjs.com/package/@types/mocha)

# Credits
These definitions were written by [Tom Harley](https://github.com/magnostherobot), and [Noah May](https://github.com/nmay231).

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