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

Commit 7e06e0c9 by Jan Aagaard Meier

Removed a couple of places with transaction: null, added CLS as dev-dependency a…

…nd fixed cls test for sqlite
1 parent 3dd80fde
......@@ -832,9 +832,9 @@ module.exports = (function() {
, where;
if (countOrOptions === undefined) {
countOrOptions = { by: 1, transaction: null };
countOrOptions = { by: 1 };
} else if (typeof countOrOptions === 'number') {
countOrOptions = { by: countOrOptions, transaction: null };
countOrOptions = { by: countOrOptions };
}
countOrOptions = Utils._.extend({
......@@ -892,9 +892,9 @@ module.exports = (function() {
});
if (countOrOptions === undefined) {
countOrOptions = { by: 1, transaction: null };
countOrOptions = { by: 1 };
} else if (typeof countOrOptions === 'number') {
countOrOptions = { by: countOrOptions, transaction: null };
countOrOptions = { by: countOrOptions };
}
if (countOrOptions.by === undefined) {
......
......@@ -46,7 +46,6 @@ module.exports = (function() {
var self = this;
options = Utils._.extend({
transaction: null,
raw: true
}, options || {});
......@@ -285,7 +284,6 @@ module.exports = (function() {
QueryInterface.prototype.showAllTables = function(options) {
var self = this;
options = Utils._.extend({
transaction: null,
raw: true,
type: QueryTypes.SHOWTABLES
}, options || {});
......
......@@ -1075,8 +1075,7 @@ module.exports = (function() {
}
return new Promise(transactionResolver);
} else {
if (ns) {
} else if (ns) {
var context = ns.createContext();
return ns.bind(function () {
......@@ -1094,7 +1093,6 @@ module.exports = (function() {
} else {
return transaction.prepareEnvironment().return(transaction);
}
}
};
Sequelize.prototype.log = function() {
......
......@@ -43,6 +43,7 @@
"validator": "~3.22.1"
},
"devDependencies": {
"continuation-local-storage": "3.1.2",
"chai-as-promised": "^4.1.1",
"sqlite3": "~3.0.0",
"mysql": "~2.5.0",
......
......@@ -13,8 +13,10 @@ chai.config.includeStack = true;
describe(Support.getTestDialectTeaser("Continuation local storage"), function () {
before(function () {
this.sequelize = Support.createSequelizeInstance({
return Support.prepareTransactionTest(Support.createSequelizeInstance({
namespace: cls.createNamespace('sequelize')
})).bind(this).then(function (sequelize) {
this.sequelize = sequelize;
});
});
......@@ -91,7 +93,7 @@ describe(Support.getTestDialectTeaser("Continuation local storage"), function ()
});
});
// Wait for 500 ms - should be enough time to get everything set up
// Wait for 400 ms - should be enough time to get everything set up
return Promise.delay(400).bind(this).then(function () {
expect(transactionSetup).to.be.ok;
expect(transactionEnded).not.to.be.ok;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!