Skip to content

Commit

Permalink
version 2.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
helloyou2012 committed Aug 30, 2019
1 parent af959e7 commit d3c1b90
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
2 changes: 2 additions & 0 deletions lib/orm.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ module.exports = (configs) => {

// object for exports
const database = {
Op: Sequelize.Op,
Sequelize: Sequelize,
sequelize: sequelize,
sync: sequelize.sync.bind(sequelize)
};
Expand Down
1 change: 1 addition & 0 deletions lib/sql.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';

const squel = require('squel');

module.exports = (sequelize, dialect) => {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koa-orm",
"version": "2.3.5",
"version": "2.3.6",
"description": "koa orm using sequelize & squel",
"main": "index.js",
"scripts": {
Expand All @@ -25,15 +25,15 @@
},
"homepage": "https://github.com/d-band/koa-orm#readme",
"dependencies": {
"sequelize": "^5.9.0",
"sequelize": "^5.17.1",
"squel": "^5.13.0"
},
"devDependencies": {
"chai": "^4.2.0",
"coveralls": "^3.0.4",
"koa": "^2.7.0",
"mocha": "^6.1.4",
"mysql2": "^1.6.5",
"coveralls": "^3.0.6",
"koa": "^2.8.1",
"mocha": "^6.2.0",
"mysql2": "^1.7.0",
"nyc": "^14.1.1",
"supertest": "^4.0.2"
}
Expand Down
13 changes: 13 additions & 0 deletions test/orm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ describe('orm test', function() {
.then(() => done());
});

it('duplicate name', done => {
expect(db).to.have.property('Op');
expect(db).to.have.property('Sequelize');
expect(db).to.have.property('sequelize');
expect(db).to.have.property('sync');
expect(db).to.have.property('sql');
expect(db).to.have.property('query');
expect(db).to.have.property('queryOne');
expect(db).to.have.property('Foo');
expect(db).to.have.property('Bar');
done();
});

it('duplicate name', done => {
const fn = orm.bind(null, [config, config]);
expect(fn).to.throw('Duplicate name: \'orm_test\'');
Expand Down

0 comments on commit d3c1b90

Please sign in to comment.