Skip to content

Commit eeb62ba

Browse files
committed
test: Replace __dirname concatenations in require(...) with relative paths
Replaces __dirname concatentation in pg test scripts so that editors like VS Code can automatically generate typings and support code navigation (F12).
1 parent f3136a7 commit eeb62ba

30 files changed

+45
-45
lines changed

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 () {

packages/pg/test/integration/connection/copy-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 assert = require('assert')
44

55
test('COPY FROM events check', function () {

0 commit comments

Comments
 (0)