0.0.2 • Published 10 years ago

mongo_fixtures v0.0.2

Weekly downloads
2
License
WTFPL
Repository
github
Last release
10 years ago

Mongo Fixtures

Let's you reset your testing database with fixtures. A common use-case is integration testing. Before firing your tests, you want your testing database to be in a pre-configured state. To achieve that:

var mongoFixtures = require('mongo_fixtures');

mongoFixtures('mongodb://localhost/testing_db', {
	'User': [
		{ username: 'foo' },
		{ username: 'bar' }
	],

	'Coffee': [
		{ from: 'brazil' }
	]
}, function () {
	console.log('done');
});
~~~

The above resets any collection in `testing_db`, and inserts in `users` and
`coffees` the given documents.

Have a great day!

## License
    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                Version 2, December 2004

Copyright (C) 2014 Michael Sokol misokol123@gmail.com

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

        DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  1. You just DO WHAT THE FUCK YOU WANT TO.