Skip to content
sequelize fixture
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib assign associate identifier Jul 16, 2014
test add test for gene 0 Jun 19, 2014
.editorconfig init sequelize-fixture May 4, 2014
.npmignore
.travis.yml
History.md
LICENSE add README LICENSE May 4, 2014
README.md some tip in readme May 7, 2014
index.js add coverage package Jun 19, 2014
package.json

README.md

Sequelize Fixture

Build Status

Installation

Install from npm registry:

$ npm install sequelize-fixture

Usage

var Sequelize = require('sequelize');

require('sequelize-fixture')(Sequelize);


it('should generate fixture base on define of Model', function () {
    var Foo = sequelize.define('Foo', {
      title: Sequelize.STRING(64),
      string: Sequelize.STRING,
      text: Sequelize.TEXT,
      bool: Sequelize.BOOLEAN,
      num: Sequelize.INTEGER,
      bignum: Sequelize.BIGINT,
      float: Sequelize.FLOAT,
      date: Sequelize.DATE,
      uuid: Sequelize.UUID,
    });

    var fixture = Foo.fixtures();
    assert.ok(fixture.title);
    assert.ok(fixture.string);
    assert.ok(fixture.text);
    assert.equal(typeof fixture.bool, 'boolean');
    assert.ok(fixture.num);
    assert.ok(fixture.bignum);
    assert.ok(fixture.float);
    assert.ok(fixture.date);
    assert.ok(fixture.uuid);
});

more usage see my test

datatypes_test model_test associate_test

Pull Request Welcome

Thank you!

You can’t perform that action at this time.