Skip to content

Commit

Permalink
fix bad publish
Browse files Browse the repository at this point in the history
  • Loading branch information
mickhansen committed Nov 26, 2015
1 parent fce6cae commit 79d7e95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "graphql-sequelize",
"version": "0.14.0",
"version": "0.14.1",
"description": "GraphQL & Relay for MySQL & Postgres via Sequelize",
"main": "lib/index.js",
"options": {
"mocha": "--require scripts/mocha-bootload"
},
"scripts": {
"prepublish": "npm run check",
"prepublish": "npm run check && npm run build",
"check": "npm run lint && npm run test-unit",
"lint": "eslint src",
"build": "rm -rf lib/* && babel src --ignore test --optional runtime --out-dir lib",
Expand Down
9 changes: 7 additions & 2 deletions test/unit/attributeFields.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ describe('attributeFields', function () {
float: {
type: Sequelize.FLOAT
},
decimal: {
type: Sequelize.DECIMAL
},
enum: {
type: Sequelize.ENUM('first', 'second')
},
Expand All @@ -62,7 +65,7 @@ describe('attributeFields', function () {
it('should return fields for a simple model', function () {
var fields = attributeFields(Model);

expect(Object.keys(fields)).to.deep.equal(['id', 'email', 'firstName', 'lastName', 'float', 'enum', 'enumTwo', 'list', 'virtualInteger', 'virtualBoolean']);
expect(Object.keys(fields)).to.deep.equal(['id', 'email', 'firstName', 'lastName', 'float', 'decimal', 'enum', 'enumTwo', 'list', 'virtualInteger', 'virtualBoolean']);

expect(fields.id.type).to.be.an.instanceOf(GraphQLNonNull);
expect(fields.id.type.ofType).to.equal(GraphQLInt);
Expand All @@ -82,14 +85,16 @@ describe('attributeFields', function () {

expect(fields.float.type).to.equal(GraphQLFloat);

expect(fields.decimal.type).to.equal(GraphQLString);

expect(fields.virtualInteger.type).to.equal(GraphQLInt);

expect(fields.virtualBoolean.type).to.equal(GraphQLBoolean);
});

it('should be possible to exclude fields', function () {
var fields = attributeFields(Model, {
exclude: ['id', 'email', 'float', 'enum', 'enumTwo', 'list', 'virtualInteger', 'virtualBoolean']
exclude: ['id', 'email', 'float', 'decimal', 'enum', 'enumTwo', 'list', 'virtualInteger', 'virtualBoolean']
});

expect(Object.keys(fields)).to.deep.equal(['firstName', 'lastName']);
Expand Down

0 comments on commit 79d7e95

Please sign in to comment.