New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mockit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockit

Simple module dependency mocking

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Mockit

Mockit is a simple library for mocking module dependencies during testing. Other dependency injection libraries create a sandbox around the tested module forcing the user to deal with an entirely new module context. Mockit simply overwrites the mocked dependencies and includes the module in its original scope.

Installation

$ npm install mockit

Usage

To mock the http module in a required file:

var mockit = require('mockit');

var mockHttp = {
  // Mocked methods here...
};

var Downloader = mockit('../lib/downloader', {
  http: mockHttp
});

Keywords

unit

FAQs

Package last updated on 09 Sep 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts