sequelize-test-fixtures
v1.2.1
Published
Sequelize test fixtures
Downloads
55
Maintainers
Readme
sequelize-test-fixtures
Creates sequelize test fixtures Allows easy fixtures for testing sequelize driven database systems
Usage
File tree:
- index.js
- fixtures/
- test_fixture.js
- test.js
index.js
var models = // Get your sequelize models somehow
var fixtures = require( 'sequelize-test-fixtures' );
fixtures( modles, 'fixtures/' );
fixtures/test_fixture.js
module.exports = [
{
model: 'TestModel',
key: 'test_model',
data: {
name: 'test'
}
}
];
test.js
var fixture = require( 'fixture' );
fixture.load( 'test_fixture' )
.then( function( fixtures ) {
console.log( fixtures );
} );
Output:
{
"test_model": {
"name": "test"
}
}