Neighborly Package Megalodon
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    docparse-model-stubpublic

    Stub out the database with an in-memory store for tests involving a docparse model

    Build Status Dependency Status Dependency tracking by David

    Usage

    /**
     * Stub out your model by requiring it via docparse-model-stub. Now since docparse-upload is cached,
     * future calls to require('docparse-upload') will load the mocked version
     **/
    var Upload = require('docparse-model-stub')('docparse-upload');
    var upload = new Upload();
    upload.status = 'dummy status';
    upload.hash = 'dummy hash';
    upload.supplier_code = 'dummy supplier code';
    upload.supplier = new ObjectId();
    upload.save(function (err) {
      // note that save will complete even though we have not connected mongoose to a database
      should.not.exist(err, 'error saving upload: ' + err);
      cb(null, upload);
    });

    Installation

    npm install docparse-model-stub

    Keywords

    none

    install

    npm i docparse-model-stub

    Downloadsweekly downloads

    2

    version

    1.0.0

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar