connection-manager.js
1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'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');
});
});