couchdb-fixture

0.1.1 • Public • Published

couchdb-fixture

Initialize a couchdb database with fixtures meant for use with mocha. The couchdb server that it initializes will not interfere with any couchdb server that is currently running on the system and the server's databases will be immediately removed after each test.

Usage

var nanoInit = require('nano');
var couchdbFixture = require('couchdb-fixture');
 
describe('thisIsSomeTest', function() {
  couchdbFixture({
    'someTestDatabaseName': [
      {
        _id: "some_doc_id",
        value: "some_value"
      }
    ]
  }).beforeEach(function(fixtureContext, done) {
    nano = nanoInit(fixtureContext.couchdbUrl);
 
    done();
  });
});

Dependencies (6)

Dev Dependencies (1)

Package Sidebar

Install

npm i couchdb-fixture

Weekly Downloads

2

Version

0.1.1

License

none

Last publish

Collaborators

  • virtru-corp