Skip to content

Commit ff302b1

Browse files
authored
Merge pull request brianc#2221 from sehrope/misc-test-cleanup
Test require clean up and refactoring to remove BufferList global
2 parents f3136a7 + 96e2f20 commit ff302b1

33 files changed

+50
-58
lines changed

packages/pg/test/buffer-list.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
2-
global.BufferList = function () {
2+
3+
const BufferList = function () {
34
this.buffers = []
45
}
56
var p = BufferList.prototype

packages/pg/test/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
var ConnectionParameters = require(__dirname + '/../lib/connection-parameters')
2+
var ConnectionParameters = require('../lib/connection-parameters')
33
var config = new ConnectionParameters(process.argv[2])
44

55
for (var i = 0; i < process.argv.length; i++) {

packages/pg/test/integration/client/api-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
var helper = require(__dirname + '/../test-helper')
2+
var helper = require('../test-helper')
33
var pg = helper.pg
44

55
var suite = new helper.Suite()

packages/pg/test/integration/client/appname-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ suite.test('application_name has precedence over fallback_application_name', fun
7171

7272
suite.test('application_name from connection string', function (done) {
7373
var appName = 'my app'
74-
var conParams = require(__dirname + '/../../../lib/connection-parameters')
74+
var conParams = require('../../../lib/connection-parameters')
7575
var conf
7676
if (process.argv[2]) {
7777
conf = new conParams(process.argv[2] + '?application_name=' + appName)

packages/pg/test/integration/client/array-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
var helper = require(__dirname + '/test-helper')
2+
var helper = require('./test-helper')
33
var pg = helper.pg
44

55
var suite = new helper.Suite()

packages/pg/test/integration/client/query-as-promise-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22
var bluebird = require('bluebird')
3-
var helper = require(__dirname + '/../test-helper')
3+
var helper = require('../test-helper')
44
var pg = helper.pg
55

66
process.on('unhandledRejection', function (e) {

packages/pg/test/integration/client/query-column-names-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
var helper = require(__dirname + '/../test-helper')
2+
var helper = require('../test-helper')
33
var pg = helper.pg
44

55
new helper.Suite().test('support for complex column names', function () {

packages/pg/test/integration/client/ssl-tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
2-
var pg = require(__dirname + '/../../../lib')
3-
var config = require(__dirname + '/test-helper').config
2+
var pg = require('../../../lib')
3+
var config = require('./test-helper').config
44
test('can connect with ssl', function () {
55
return false
66
config.ssl = {

packages/pg/test/integration/client/type-coercion-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
var helper = require(__dirname + '/test-helper')
2+
var helper = require('./test-helper')
33
var pg = helper.pg
44
var sink
55
const suite = new helper.Suite()

packages/pg/test/integration/connection/bound-command-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
var helper = require(__dirname + '/test-helper')
2+
var helper = require('./test-helper')
33
// http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
44

55
test('flushing once', function () {

0 commit comments

Comments
 (0)