0.3.3 • Published 11 years ago

mongo-test-db v0.3.3

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

mongo-test-db

mongo-test-db is small utility to load database connections and fixtures suitable for testing.

Usage

// simplest use case without fixtures
var MongoTestDb = require('mongo-test-db');
var db = new MongoTestDb();

db.open(function (err) {
  if (err) { throw err; }
  // do some stuff with db.connection
});

// example with fixtures
var fixtures = {
  myCollection: [
    { foo: 'bar' },
    { qux: 'raboof' }
  ]
}

db.open(fixtures, function (err) {
  if (err) { throw err; }
  // now a collection named "myCollection" is created that contains two
  // items
  // do some stuff with db.connection
});

Installation

$ npm install mongo-test-db

License

MIT, see LICENSE

Bugs

See https://github.com/timkuijsten/mongo-test-db/issues.

0.3.3

11 years ago

0.3.2

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago