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

mocksy

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocksy

Mock http server for testing. Regurgitates the request object.

  • 0.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-96.39%
Maintainers
1
Weekly downloads
 
Created
Source

mocksy

Mock Node.js http server for testing. Regurgitates the request object.

Install

npm install mocksy --save-dev

Usage

var Mocksy = require('mocksy');
var mocksy = new Mocksy({port: 4321});

// In your test runner

describe('Some http endpoint', function () {
  beforeEach(function (done) {
    mocksy.start(done);
  });
  
  afterEach(function (done) {
    mocksy.stop(done);
  });
  
  it('should just work, right?', function (done) {
    // Do your http requests
  });
});

API

new Mocksy([{port: 1337}]);

Create and instance of the mocksy mock server. Optionally pass in the following options

  • port - server port. defaults to 1137 if no port is provided
start(callback)

Starts the mocksy mock server. Takes a callback as the only argument.

stop(callback)

Stops the mocksy mock server. Takes a callback as the only argument.

Run Tests

npm test

Keywords

FAQs

Package last updated on 04 Oct 2013

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