Skip to content

A small library to enable lightweight mocking for tests

License

Notifications You must be signed in to change notification settings

konobi/node-mocked

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

License

MIT. (See LICENSE file)

Author

Scott McWhirter - Github profile

About

A small library to enable lightweight mocking for tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published