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

Commit a6c19754 by Matt Broadstone

add dialect support checking to tests

this allows us to test for dialect features in tests, see
test/transaction.test.js for an example of checking for row locking
support before running a test
1 parent 5f0c5054
Showing with 6 additions and 5 deletions
...@@ -187,7 +187,8 @@ var Support = { ...@@ -187,7 +187,8 @@ var Support = {
} }
}; };
var sequelize = Support.createSequelizeInstance(); var sequelize = Support.sequelize = Support.createSequelizeInstance();
// //
// For Postgres' HSTORE functionality and to properly execute it's commands we'll need this... // For Postgres' HSTORE functionality and to properly execute it's commands we'll need this...
before(function() { before(function() {
......
...@@ -4,8 +4,8 @@ var chai = require('chai') ...@@ -4,8 +4,8 @@ var chai = require('chai')
, dialect = Support.getTestDialect() , dialect = Support.getTestDialect()
, Promise = require(__dirname + '/../lib/promise') , Promise = require(__dirname + '/../lib/promise')
, Transaction = require(__dirname + '/../lib/transaction') , Transaction = require(__dirname + '/../lib/transaction')
, sinon = require('sinon'); , sinon = require('sinon')
, current = Support.sequelize;
describe(Support.getTestDialectTeaser("Transaction"), function () { describe(Support.getTestDialectTeaser("Transaction"), function () {
this.timeout(4000); this.timeout(4000);
...@@ -55,7 +55,7 @@ describe(Support.getTestDialectTeaser("Transaction"), function () { ...@@ -55,7 +55,7 @@ describe(Support.getTestDialectTeaser("Transaction"), function () {
}); });
}); });
if (dialect !== 'sqlite') { if (current.dialect.supports.lock) {
describe('row locking', function () { describe('row locking', function () {
this.timeout(10000); this.timeout(10000);
it('supports for update', function (done) { it('supports for update', function (done) {
...@@ -75,7 +75,7 @@ describe(Support.getTestDialectTeaser("Transaction"), function () { ...@@ -75,7 +75,7 @@ describe(Support.getTestDialectTeaser("Transaction"), function () {
where: { where: {
username: 'jan' username: 'jan'
} }
}, { }, {
lock: t1.LOCK.UPDATE, lock: t1.LOCK.UPDATE,
transaction: t1 transaction: t1
}).then(function (t1Jan) { }).then(function (t1Jan) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!