MCPcopy
hub / github.com/sequelize/sequelize / assertSameConnection

Function assertSameConnection

test/integration/pool.test.js:11–37  ·  view source on GitHub ↗
(newConnection, oldConnection)

Source from the content-addressed store, hash-verified

9const delay = require('delay');
10
11function assertSameConnection(newConnection, oldConnection) {
12 switch (dialect) {
13 case 'postgres':
14 expect(oldConnection.processID).to.be.equal(newConnection.processID).and.to.be.ok;
15 break;
16
17 case 'oracle':
18 expect(oldConnection).to.be.equal(newConnection);
19 break;
20
21 case 'mariadb':
22 case 'mysql':
23 expect(oldConnection.threadId).to.be.equal(newConnection.threadId).and.to.be.ok;
24 break;
25
26 case 'db2':
27 expect(newConnection.connected).to.equal(oldConnection.connected).and.to.be.ok;
28 break;
29
30 case 'mssql':
31 expect(newConnection.dummyId).to.equal(oldConnection.dummyId).and.to.be.ok;
32 break;
33
34 default:
35 throw new Error('Unsupported dialect');
36 }
37}
38
39function assertNewConnection(newConnection, oldConnection) {
40 switch (dialect) {

Callers 1

pool.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected