不要怂,就是干,撸起袖子干!

Commit c2d29dbe by Sascha Depold

exec specs for all dialects

1 parent d0d4d498
Showing with 19 additions and 15 deletions
...@@ -2,29 +2,33 @@ if (typeof require === 'function') { ...@@ -2,29 +2,33 @@ if (typeof require === 'function') {
const buster = require("buster") const buster = require("buster")
, Helpers = require('../buster-helpers') , Helpers = require('../buster-helpers')
, Sequelize = require('../../index') , Sequelize = require('../../index')
, dialects = Helpers.getSupportedDialects()
} }
buster.spec.expose() buster.spec.expose()
describe('Mixin', function() { dialects.forEach(function(dialect) {
before(function(done) { describe('Mixin@' + dialect, function() {
Helpers.initTests({ before(function(done) {
beforeComplete: function(sequelize) { Helpers.initTests({
this.sequelize = sequelize dialect: dialect,
}.bind(this), beforeComplete: function(sequelize) {
onComplete: done this.sequelize = sequelize
}.bind(this),
onComplete: done
})
}) })
})
describe('getAssociation', function() { describe('getAssociation', function() {
it('returns the respective part of the association for 1:1 associations', function() { it('returns the respective part of the association for 1:1 associations', function() {
var User = this.sequelize.define('User', {}) var User = this.sequelize.define('User', {})
var Task = this.sequelize.define('Task', {}) var Task = this.sequelize.define('Task', {})
User.hasOne(Task) User.hasOne(Task)
Task.belongsTo(User) Task.belongsTo(User)
expect(User.getAssociation(Task).target).toEqual(Task) expect(User.getAssociation(Task).target).toEqual(Task)
})
}) })
}) })
}) })
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!