| 9 | const delay = require('delay'); |
| 10 | |
| 11 | function 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 | |
| 39 | function assertNewConnection(newConnection, oldConnection) { |
| 40 | switch (dialect) { |