Skip to content

Commit

Permalink
Add code coverage ignores to mssql monkey-patching
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Nov 22, 2018
1 parent d5c9563 commit 45fd21c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dialects/mssql/index.js
Expand Up @@ -61,7 +61,9 @@ assign(Client_MSSQL.prototype, {

// TODO: remove mssql implementation all together and use tedious directly

/* istanbul ignore next */
const mssqlVersion = require('mssql/package.json').version;
/* istanbul ignore next */
if (mssqlVersion === '4.1.0') {
mssqlTedious.ConnectionPool.prototype.release = release;
mssqlTedious.ConnectionPool.prototype._poolCreate = _poolCreate;
Expand All @@ -76,14 +78,15 @@ assign(Client_MSSQL.prototype, {
}
}

/* istanbul ignore next */
// in some rare situations release is called when stream is interrupted, but
// after pool is already destroyed
function release(connection) {
if (this.pool) {
this.pool.release(connection);
}
}

/* istanbul ignore next */
function _poolCreate() {
// implementation is copy-pasted from https://github.com/tediousjs/node-mssql/pull/614
return new base.Promise((resolve, reject) => {
Expand Down

0 comments on commit 45fd21c

Please sign in to comment.