Skip to content
This repository has been archived by the owner. It is now read-only.
Setup your test database using fixtures in a breeze.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
example Initial commit May 28, 2013
.gitignore Update Jun 2, 2013


Node.js module to setup your test database using fixtures in a breeze. Inspired by Rails fixtures.


  • Only supports sequelize ORM at the moment.
  • I haven't tested many-to-many relationships for now but I will as soon as possible.


npm install fixer


See example/load_fixtures.js.

var fixer = require('fixer');
 * @param {Object} fixtures associative object. keys represent model names and values contain an array of fixtures for that model. fixture are simple associative objects.
 * @param {Object} models associative object. key represents the model
 * name and value is the Sequelize model
fixer(fixtures, models).load(function (err) {
  if (err) return console.error(err);
  console.log('Finished loading fixtures into database.');

Example fixtures (in coffeescript):

module.exports =
    first_name: 'Olivier'
    last_name: 'Lalonde'
    email: ''
    school: 'NYU'
    first_name: 'Mark'
    last_name: 'Zuckerberg'
    email: ''
    school: 'Harvard'

module.exports =
    name: 'New York University'
    email: ''
    name: 'University of Harvard'
    email: ''

You can reference other fixtures by their key. For example, reference fixture schools.NYU.

You can’t perform that action at this time.