Skip to content
forked from bredikhin/barrels

Simple DB Fixtures for Sails.js

License

Notifications You must be signed in to change notification settings

blah238/barrels

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple DB Fixtures for Sails.js

Build Status Dependency Status

Installation

$ npm install barrels

or add the module to your package.json and run

$ npm install

Usage

Drop your fixtures in test/fixtures as JSON files named after your models.

Once your Sails.js server is started:

var barrels = require('barrels');
var fixtures = barrels.load().objects;
barrels.populate(function(err) {
  ...
});

After load the fixture data will be accessible via the objects property.

Populate'ing the test database involves two steps:

  • Removing any existing data from the collection corresponding to the fixture
  • Loading the fixture data into the test database

Dependencies

License

The MIT License

Copyright (c) 2013 Ruslan Bredikhin

About

Simple DB Fixtures for Sails.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published