From de30465325e71f4fec0be815948235a0c01cfaec Mon Sep 17 00:00:00 2001 From: Ben Page Date: Thu, 9 Jun 2016 13:46:46 -0500 Subject: [PATCH] test: consolidated tests and added `npm test` script --- package.json | 5 ++++- test/naming.test.js | 12 ------------ test/{connection-pool.test.js => test.js} | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+), 13 deletions(-) delete mode 100644 test/naming.test.js rename test/{connection-pool.test.js => test.js} (96%) mode change 100755 => 100644 diff --git a/package.json b/package.json index 2b9e00b..a707ef4 100755 --- a/package.json +++ b/package.json @@ -40,5 +40,8 @@ "bugs": { "url": "https://github.com/pekim/tedious-connection-pool/issues" }, - "homepage": "https://github.com/pekim/tedious-connection-pool" + "homepage": "https://github.com/pekim/tedious-connection-pool", + "scripts": { + "test": "node_modules/.bin/mocha test/test.js" + } } diff --git a/test/naming.test.js b/test/naming.test.js deleted file mode 100644 index 4ce6711..0000000 --- a/test/naming.test.js +++ /dev/null @@ -1,12 +0,0 @@ -var assert = require('assert'); -var Connection = require('tedious').Connection; - -describe('Connection', function () { - it('Name Collision', function () { - assert(!Connection.prototype.release); - - var con = new Connection({}); - assert(!con.pool); - con.close(); - }); -}); diff --git a/test/connection-pool.test.js b/test/test.js old mode 100755 new mode 100644 similarity index 96% rename from test/connection-pool.test.js rename to test/test.js index a133340..642823a --- a/test/connection-pool.test.js +++ b/test/test.js @@ -1,6 +1,7 @@ var assert = require('assert'); var Request = require('tedious').Request; var ConnectionPool = require('../lib/connection-pool'); +var Connection = require('tedious').Connection; var connectionConfig = { userName: 'test', @@ -32,7 +33,27 @@ ALTER ROLE SQLAgentUserRole ADD MEMBER test ALTER LOGIN test DISABLE */ +describe('Name Collision', function () { + + it('release', function () { + assert(!Connection.prototype.release); + + var con = new Connection({}); + assert(!con.release); + con.close(); + }); + + it('pool', function () { + assert(!Connection.prototype.pool); + + var con = new Connection({}); + assert(!con.pool); + con.close(); + }); +}); + describe('ConnectionPool', function () { + it('min', function (done) { this.timeout(10000);