Giter VIP home page Giter VIP logo

nockturnal's Introduction

nockturnal

A simplifying recorder for nock, the HTTP request mocker for node.

nockturnal is inspired by the nock recorder described by Diana Thayer.

It simplifies the task to recording nock fixtures, optimizing to the case of pre-processing the recording before writing fixtures and post-processing them before loading them up.

This is particularly useful when one wants to prevent leakage of sensitive information like API keys, passwords and the like.

If you use other advanced features of nock, we still got you covered!

Installing

npm install nockturnal

How to use

// in test/test_file.js

// all occurances of key1 will be replace with place_holder1 in the fixtures stored.
var place_holders = {
        key1: place_holder1,
        key2: place_holder2
    },
    nockturnal = require("nockturnal")("app_name", {
        folders: {
            fixtures: "test/fixtures" // folder to find/store fixtures in
        },
        place_holders: {
            key1: place_holder1
        }
    });

describe("my_app", function(){
    before(function() {
        nockturnal.before();
    });

    // ... your regular tests

    after(function(done) {
        nockturnal.after(done);
    });
});

nockturnal's People

Contributors

sethmcl avatar sramam avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.