Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

component-mocker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-mocker

Let you mock objects easily

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

component-mocker

This package provides functionality for mocking objects easily (including functions and classes). It has been extracted from jest. You can find detailed documentation in the index.js file. The LICENSE and PATENTS files are copies from the jest project.

Example usage

var mocker = require('component-mocker');
var myModule = ...; // Your module that you want to mock
var myModuleMetadata = mocker.getMetadata(myModule);
var myModuleMock = mocker.generateFromMetadata(myModuleMetadata);

In browser usage

You can also use the index.js script in the browser. The module is then available on the global scope under the name mocker. You can also run it in no conflict mode by calling var mocker = mocker.noConflict().

Keywords

FAQs

Package last updated on 25 May 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc