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

Commit c428e40a by Willyham

Fix and simplify tests

1 parent 06aa7aae
...@@ -35,7 +35,7 @@ describe('Connction Manager', function() { ...@@ -35,7 +35,7 @@ describe('Connction Manager', function() {
var options = { var options = {
replication: null replication: null
}; };
var sequelize = Support.getSequelizeInstance(baseConf.database, baseConf.username, baseConf.password, options); var sequelize = Support.createSequelizeInstance(options);
var connectionManager = new ConnectionManager(Support.getTestDialect(), sequelize); var connectionManager = new ConnectionManager(Support.getTestDialect(), sequelize);
var poolSpy = sandbox.spy(Pooling, "Pool"); var poolSpy = sandbox.spy(Pooling, "Pool");
...@@ -50,7 +50,7 @@ describe('Connction Manager', function() { ...@@ -50,7 +50,7 @@ describe('Connction Manager', function() {
read: [_.clone(poolEntry), _.clone(poolEntry)] read: [_.clone(poolEntry), _.clone(poolEntry)]
} }
}; };
var sequelize = Support.getSequelizeInstance(baseConf.database, baseConf.username, baseConf.password, options); var sequelize = Support.createSequelizeInstance(options);
var connectionManager = new ConnectionManager(Support.getTestDialect(), sequelize); var connectionManager = new ConnectionManager(Support.getTestDialect(), sequelize);
var poolSpy = sandbox.spy(Pooling, "Pool"); var poolSpy = sandbox.spy(Pooling, "Pool");
...@@ -70,7 +70,7 @@ describe('Connction Manager', function() { ...@@ -70,7 +70,7 @@ describe('Connction Manager', function() {
read: [slave1, slave2] read: [slave1, slave2]
} }
}; };
var sequelize = Support.getSequelizeInstance(baseConf.database, baseConf.username, baseConf.password, options); var sequelize = Support.createSequelizeInstance(options);
var connectionManager = new ConnectionManager(Support.getTestDialect(), sequelize); var connectionManager = new ConnectionManager(Support.getTestDialect(), sequelize);
var resolvedPromise = new Promise(function(resolve) { var resolvedPromise = new Promise(function(resolve) {
...@@ -112,7 +112,7 @@ describe('Connction Manager', function() { ...@@ -112,7 +112,7 @@ describe('Connction Manager', function() {
read: [_.clone(poolEntry)] read: [_.clone(poolEntry)]
} }
}; };
var sequelize = Support.getSequelizeInstance(baseConf.database, baseConf.username, baseConf.password, options); var sequelize = Support.createSequelizeInstance(options);
var connectionManager = new ConnectionManager(Support.getTestDialect(), sequelize); var connectionManager = new ConnectionManager(Support.getTestDialect(), sequelize);
var resolvedPromise = new Promise(function(resolve) { var resolvedPromise = new Promise(function(resolve) {
......
...@@ -77,10 +77,9 @@ describe(Support.getTestDialectTeaser('Sequelize#transaction'), function() { ...@@ -77,10 +77,9 @@ describe(Support.getTestDialectTeaser('Sequelize#transaction'), function() {
// how could we enforce an authentication error in sqlite? // how could we enforce an authentication error in sqlite?
} else { } else {
it('gets triggered once an error occurs', function(done) { it('gets triggered once an error occurs', function(done) {
var sequelize = Support.createSequelizeInstance();
// lets overwrite the host to get an error // Supply bad config to force an error
sequelize.config.username = 'foobarbaz'; var sequelize = Support.getSequelizeInstance('this', 'is', 'fake config');
sequelize sequelize
.transaction().then(function() {}) .transaction().then(function() {})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!