# mocked

> A small library to enable lightweight mocking for tests

Latest version **0.0.4** (published 2016-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install mocked
pnpm add mocked
yarn add mocked
bun add mocked
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2016-07-24 |
| First published | 2012-06-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Scott McWhirter |
| Maintainers | konobi |
| Keywords | mock, mocking, test, unittest |

## Links

- npm: https://www.npmjs.com/package/mocked
- Repository: https://github.com/konobi/node-mocked
- Homepage: https://github.com/konobi/node-mocked#readme
- Issues: https://github.com/konobi/node-mocked/issues
- npm.io page: https://npm.io/package/mocked

## 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
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2016-07-24
- 0.0.3 — 2013-07-28
- 0.0.2 — 2012-06-29
- 0.0.1 — 2012-06-18

## README

Mocked is a small library that allows you to intercept calls to require() and
load the specified libaries from a directory of your choosing.

# Installation

    npm install mocked

# Usage

The usage is as so:

    var mocked = require('mocked');

    // Use the directory ./tests/mocks and list the libs to be mocked
    mocked('./tests/mocks', ['http', 'net', './some/dependency']);

    // this will be at ./tests/mocks/deps/logger.js
    var logger = require('./deps/logger');

# Github

For git repository and issues, please see [](http://github.com/konobi/node-mocked)

# License

MIT. (See LICENSE file)

# Author

Scott McWhirter - [Github profile](http://github.com/konobi)

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