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

mock-pointdns

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mock-pointdns

Mocks of the PointDNS API for use in local testing. See https://pointhq.com/api/docs

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Mock PointDNS

Build Status

Helps integrate with the PointDNS API through acceptance testing.

Getting Started

  1. Clone the repo: git clone https://github.com/codesleuth/mock-pointdns && cd mock-pointdns
  2. Install the dependencies: npm install

To use the mock server in testing, take a look at the following example:

var mockpointdns = require('mock-pointdns'),
    request = require('supertest');

describe('Verify Mock PointDNS Server', function () {

  var apitoken;
  var zone;
  var mockServer;
  var mockServerUrl;

  before(function (done) {
    apitoken = mockpointdns.setApiToken();
    zone = mockpointdns.addZone();

    mockServer = mockpointdns.app.listen(process.env.PORT, process.env.IP, function () {
      mockServerUrl = 'http://' + process.env.IP + ':' + process.env.PORT;
      done();
    });
  });

  it('/zones should return the expected zone', function (done) {
    request(mockServerUrl)
      .get('/zones')
      .auth('', apitoken)
      .expect(200)
      .expect([{ zone: zone }])
      .end(done);
  });

  after(function (done) {
    mockServer.close(done);
  });
});

npm start will launch a sample app that shows how to configure and use this mock server.

npm test will run the test suite using Mocha which is required as a development dependency.

Disclaimer

This mock server is not controlled or endorsed by Copper.io in any way. The implementation may differ and may even be outdated right now. This project was intended to help mock out the expected behaviour of the PointDNS API according to the API documentation.

Contribute

If you wish to contribute, pull requests are welcome. Keeping this project up to date with the API it mocks out is key to its usefulness. Please contribute!

Keywords

FAQs

Package last updated on 28 Jun 2014

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