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

Commit f1289159 by Mick Hansen

Merge pull request #4919 from lukealbao/master

[MSSQL] Fix connection manager domain usage
2 parents 1c0d3e10 25c76623
......@@ -53,7 +53,6 @@ ConnectionManager.prototype.connect = function(config) {
// The 'tedious' driver needs domain property to be in the main Connection config object
if(config.dialectOptions.domain) {
connectionConfig.domain = config.dialectOptions.domain;
delete config.dialectOptions.domain;
}
Object.keys(config.dialectOptions).forEach(function(key) {
......
'use strict';
var chai = require('chai')
, expect = chai.expect
, Sequelize = require(__dirname + '/../../../../index');
var tedious = require('tedious')
, sinon = require('sinon')
, connectionStub = sinon.stub(tedious, 'Connection');
connectionStub.returns({on: function () {}});
describe('[MSSQL] Connection Manager', function () {
var instance
, config;
beforeEach(function () {
config = {
dialect: 'mssql',
database: 'none',
username: 'none',
password: 'none',
host: 'localhost',
port: 2433,
pool: {},
dialectOptions: {
domain: 'TEST.COM'
}
};
instance = new Sequelize(config.database
, config.username
, config.password
, config);
});
it('connectionManager.$connect() Does not delete `domain` from config.dialectOptions',
function () {
expect(config.dialectOptions.domain).to.equal('TEST.COM');
instance.dialect.connectionManager.$connect(config);
expect(config.dialectOptions.domain).to.equal('TEST.COM');
});
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!