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

Commit e290d26b by Daniel Durante

Moved the sequelize variable out of scope and changed beforeAll to afterAll for …

…clearing the database. It seems to work better.
1 parent ba8cccbb
Showing with 13 additions and 2 deletions
......@@ -2,6 +2,8 @@ var fs = require('fs')
, Sequelize = require(__dirname + "/../index")
, DataTypes = require(__dirname + "/../lib/data-types")
, config = require(__dirname + "/config/config")
, chai = require('chai')
, expect = chai.expect
module.exports = {
Sequelize: Sequelize,
......@@ -79,6 +81,14 @@ module.exports = {
})
},
checkMatchForDialects: function(dialect, value, expectations) {
if (!!expectations[dialect]) {
expect(value).to.match(expectations[dialect])
} else {
throw new Error('Undefined expectation for "' + dialect + '"!')
}
},
getTestDialect: function() {
var envDialect = process.env.DIALECT || 'mysql'
......
var Support = require(__dirname + '/support')
, dialect = Support.getTestDialect()
var sequelize = Support.createSequelizeInstance({ dialect: dialect })
before(function(done) {
var sequelize = Support.createSequelizeInstance({ dialect: dialect })
this.sequelize = sequelize
done()
})
beforeEach(function(done) {
afterEach(function(done) {
Support.clearDatabase(this.sequelize, done)
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!