sequelize-fixture

0.1.4 • Public • Published

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!

Dependents (1)

Package Sidebar

Install

npm i sequelize-fixture

Weekly Downloads

2

Version

0.1.4

License

none

Last publish

Collaborators

  • hsujian