| 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 'mariadb': |
| 18 | case 'mysql': |
| 19 | expect(oldConnection.threadId).to.be.equal(newConnection.threadId).and.to.be.ok; |
| 20 | break; |
| 21 | |
| 22 | case 'db2': |
| 23 | expect(newConnection.connected).to.equal(oldConnection.connected).and.to.be.ok; |
| 24 | break; |
| 25 | |
| 26 | case 'mssql': |
| 27 | expect(newConnection.dummyId).to.equal(oldConnection.dummyId).and.to.be.ok; |
| 28 | break; |
| 29 | |
| 30 | default: |
| 31 | throw new Error('Unsupported dialect'); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | function assertNewConnection(newConnection, oldConnection) { |
| 36 | switch (dialect) { |