# @types/mock-require

> TypeScript definitions for mock-require

Latest version **3.0.0** (published 2024-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/mock-require
pnpm add @types/mock-require
yarn add @types/mock-require
bun add @types/mock-require
```

## Health

**Score 55/100 (C)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2024-10-19 |
| First published | 2016-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

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

## Recent versions

- 3.0.0 (latest) — 2024-10-19
- 2.0.3 (ts4.5) — 2023-11-07
- 2.0.1 (ts3.8) — 2021-12-24
- 2.0.0 (ts3.2) — 2017-11-15
- 1.3.3 (ts2.3) — 2016-09-19
- 2.0.2 — 2023-10-18
- 1.3.2 — 2016-08-25
- 1.3.1 — 2016-08-22

## README

# Installation
> `npm install --save @types/mock-require`

# Summary
This package contains type definitions for mock-require (https://github.com/boblauer/mock-require).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mock-require.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mock-require/index.d.ts)
````ts
type StubFunction = (...params: any[]) => any;
type Stub = object | StubFunction;

interface Mock {
    (path: string, mockExport: string | Stub): void;
    stop(path: string): void;
    stopAll(): void;
    reRequire(path: string): any;
}

declare const mock: Mock;

export = mock;

````

### Additional Details
 * Last updated: Sat, 19 Oct 2024 03:38:51 GMT
 * Dependencies: none

# Credits
These definitions were written by .

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