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 ea

Usage no npm install needed!

<script type="module">
  import couchdbFixture from 'https://cdn.skypack.dev/couchdb-fixture';
</script>

README

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();
  });
});