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

Commit 2dc8ff64 by Eric Thompson

Added transaction type testing

1 parent 025862a1
Showing with 24 additions and 0 deletions
...@@ -238,6 +238,30 @@ describe(Support.getTestDialectTeaser('Transaction'), function() { ...@@ -238,6 +238,30 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {
}); });
}); });
}); });
describe('transaction types', function() {
it('should support default transaction type DEFERRED', function() {
return this.sequelize.transaction({
}).bind(this).then(function (t) {
return t.rollback().bind(this).then(function() {
expect(t.options.type).to.equal('DEFERRED');
});
});
});
Object.keys(Transaction.TYPES).forEach(function(key) {
it('should allow specification of ' + key + ' type', function() {
return this.sequelize.transaction({
type: key
}).bind(this).then(function (t) {
return t.rollback().bind(this).then(function() {
expect(t.options.type).to.equal(Transaction.TYPES[key]);
});
});
});
});
});
} }
if (current.dialect.supports.lock) { if (current.dialect.supports.lock) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!