Skip to content

Commit

Permalink
some tip in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xudejian committed May 7, 2014
1 parent 0edc1cf commit 5c0f27f
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,44 @@ $ npm install sequelize-fixture

## Usage

```js
```nodejs
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](https://github.com/xudejian/sequelize-fixture/blob/master/test/datatypes_test.js)
[model_test](https://github.com/xudejian/sequelize-fixture/blob/master/test/model_test.js)
[associate_test](https://github.com/xudejian/sequelize-fixture/blob/master/test/associate_test.js)

## Pull Request Welcome

Thank you!

0 comments on commit 5c0f27f

Please sign in to comment.