Skip to content

Commit 63a19ed

Browse files
author
denshikov-vovan
committed
[ #154578064 ] - removed unused variables and some updates
1 parent ca130b8 commit 63a19ed

File tree

6 files changed

+237
-246
lines changed

6 files changed

+237
-246
lines changed

tests/connection.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {settings} from './settings';
99

1010
// OBJECT QUERY TESTS
1111
// ================================================================================================
12-
describe('Object query tests', function () {
12+
describe('Object query tests;', function () {
1313

1414
it('Object query should return a single object', () => {
1515
return new Database(settings).connect().then((session) => {
@@ -218,7 +218,7 @@ describe('Object query tests', function () {
218218

219219
// LIST QUERY TESTS
220220
// ================================================================================================
221-
describe('List query tests', function () {
221+
describe('List query tests;', function () {
222222

223223
it('List query should return an array of objects', () => {
224224
return new Database(settings).connect().then((session) => {
@@ -411,7 +411,7 @@ describe('List query tests', function () {
411411

412412
// NON-RESULT QUERY TESTS
413413
// ================================================================================================
414-
describe('Non-result query tests', function () {
414+
describe('Non-result query tests;', function () {
415415

416416
it('A non-result query should produce no results', () => {
417417
return new Database(settings).connect().then((session) => {
@@ -442,7 +442,7 @@ describe('Non-result query tests', function () {
442442

443443
// MIXED QUERY TESTS
444444
// ================================================================================================
445-
describe('Mixed query tests', function () {
445+
describe('Mixed query tests;', function () {
446446

447447
it('Multiple mixed queries should produce a Map of results', () => {
448448
return new Database(settings).connect().then((session) => {
@@ -557,7 +557,7 @@ describe('Mixed query tests', function () {
557557

558558
// PARAMETRIZED QUERY TESTS
559559
// ================================================================================================
560-
describe('Parametrized query tests', function () {
560+
describe('Parametrized query tests;', function () {
561561

562562
it('Object query parametrized with number should retrive correct row', () => {
563563
return new Database(settings).connect().then((session) => {
@@ -728,7 +728,7 @@ describe('Parametrized query tests', function () {
728728

729729
// SESSION LIFECYCLE TESTS
730730
// ================================================================================================
731-
describe('Session lifecycle tests', function () {
731+
describe('Session lifecycle tests;', function () {
732732

733733
it('Closing a session should return a connection back to the pool', () => {
734734
const database = new Database(settings);
@@ -861,7 +861,7 @@ describe('Session lifecycle tests', function () {
861861

862862
// ERROR CONDITION TESTS
863863
// ================================================================================================
864-
describe('Error condition tests', function () {
864+
describe('Error condition tests;', function () {
865865

866866
it('Query execution error should close the session and release the connection back to the pool', () => {
867867
const database = new Database(settings);

tests/connectionTimeout.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {ConnectionError} from '../lib/errors';
66
import {settings} from './settings';
77
import {buildLogger} from '../lib/util';
88

9-
describe('connection timeout;', () => {
9+
describe('Pool connection timeout;', () => {
1010
before(done => {
1111
this.server = net.createServer();
1212

tests/ending.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import {expect} from 'chai';
22

33
import {Client} from 'pg';
4-
import {ConnectionPool, PoolOptions} from '../lib/Pool';
4+
import {ConnectionPool} from '../lib/Pool';
55
import {buildLogger} from '../lib/util';
66
import {settings} from './settings';
77

88
const createNewPool = (): ConnectionPool => {
99
return new ConnectionPool(settings.pool, settings.connection, buildLogger('test'));
1010
};
1111

12-
describe('pool ending;', () => {
12+
describe('Pool ending;', () => {
1313
it('ends without being used', (done) => {
1414
const pool = createNewPool();
1515

tests/errorHandling.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {expect} from 'chai';
22

33
import {Client, QueryResult} from 'pg';
44
import {ConnectionPool, PoolOptions} from '../lib/Pool';
5-
import {ConnectionError} from '../lib/errors';
65
import {settings} from './settings';
76
import {buildLogger} from '../lib/util';
87

@@ -12,7 +11,7 @@ const createNewPool = (options?: PoolOptions): ConnectionPool => {
1211
return new ConnectionPool(poolSettings, settings.connection, buildLogger('test'));
1312
};
1413

15-
describe('pool error handling;', () => {
14+
describe('Pool error handling;', () => {
1615
it('Should complete these queries without dying', done => {
1716
const iterations = 5;
1817
const pool = createNewPool();
@@ -23,7 +22,7 @@ describe('pool error handling;', () => {
2322
const runErrorQuery = (client: Client): Promise<QueryResult> => {
2423
shouldGet++;
2524

26-
return new Promise(function (resolve, reject) {
25+
return new Promise(resolve => {
2726
client.query('SELECT \'asd\'+1 ')
2827
.catch(err => {
2928
errors++;
@@ -138,7 +137,6 @@ describe('pool error handling;', () => {
138137
const iterations = 20;
139138
const queryValue = 'brianc';
140139
const pool = createNewPool({maxSize: 1});
141-
const promises = Promise.resolve();
142140
const errors = [];
143141

144142
const errorHandler = (err, cb: Function): void => {

tests/events.spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import {expect} from 'chai';
2-
import {EventEmitter} from 'events';
32

4-
import {Client, QueryResult} from 'pg';
5-
import {ConnectionPool, PoolOptions, ERROR_EVENT, CREATED_EVENT, CLOSED_EVENT} from '../lib/Pool';
6-
import {ConnectionError} from '../lib/errors';
3+
import {ConnectionPool, ERROR_EVENT, CREATED_EVENT, CLOSED_EVENT} from '../lib/Pool';
74
import {settings} from './settings';
85
import {buildLogger} from '../lib/util';
96

107
const createNewPool = (): ConnectionPool => {
118
return new ConnectionPool(settings.pool, settings.connection, buildLogger('test'));
129
};
1310

14-
describe('events;', () => {
11+
describe('Pool Events;', () => {
1512
it('emits acquire before callback', done => {
1613
const pool = createNewPool();
1714
let emittedClient;

0 commit comments

Comments
 (0)