diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 184aff0ed..11c8c9f3b 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -25,6 +25,9 @@ services: PGUSER: user PGDATABASE: data PGHOST: db + # set this to true in the development environment until I can get SSL setup on the + # docker postgres instance + PGTESTNOSSL: true # Overrides default command so things don't shut down after the process ends. command: sleep infinity diff --git a/packages/pg/test/integration/client/connection-parameter-tests.js b/packages/pg/test/integration/client/connection-parameter-tests.js index b3bf74c36..45b5eba55 100644 --- a/packages/pg/test/integration/client/connection-parameter-tests.js +++ b/packages/pg/test/integration/client/connection-parameter-tests.js @@ -1,3 +1,4 @@ +const assert = require('assert') const helper = require('../test-helper') const suite = new helper.Suite() const { Client } = helper.pg @@ -8,6 +9,7 @@ suite.test('it sends options', async () => { }) await client.connect() const { rows } = await client.query('SHOW default_transaction_isolation') - console.log(rows) + assert.strictEqual(rows.length, 1) + assert.strictEqual(rows[0].default_transaction_isolation, 'serializable') await client.end() }) diff --git a/packages/pg/test/integration/client/promise-api-tests.js b/packages/pg/test/integration/client/promise-api-tests.js index 1d6e504f2..d8128cf8b 100644 --- a/packages/pg/test/integration/client/promise-api-tests.js +++ b/packages/pg/test/integration/client/promise-api-tests.js @@ -20,7 +20,7 @@ suite.test('valid connection completes promise', () => { }) suite.test('invalid connection rejects promise', (done) => { - const client = new pg.Client({ host: 'alksdjflaskdfj' }) + const client = new pg.Client({ host: 'alksdjflaskdfj', port: 1234 }) return client.connect().catch((e) => { assert(e instanceof Error) done() diff --git a/packages/pg/test/integration/gh-issues/2079-tests.js b/packages/pg/test/integration/gh-issues/2079-tests.js index be2485794..ad1c82aac 100644 --- a/packages/pg/test/integration/gh-issues/2079-tests.js +++ b/packages/pg/test/integration/gh-issues/2079-tests.js @@ -32,7 +32,7 @@ let makeTerminatingBackend = (byte) => { suite.test('SSL connection error allows event loop to exit', (done) => { const port = makeTerminatingBackend('N') - const client = new helper.pg.Client({ ssl: 'require', port }) + const client = new helper.pg.Client({ ssl: 'require', port, host: 'localhost' }) // since there was a connection error the client's socket should be closed // and the event loop will have no refs and exit cleanly client.connect((err) => { @@ -43,7 +43,7 @@ suite.test('SSL connection error allows event loop to exit', (done) => { suite.test('Non "S" response code allows event loop to exit', (done) => { const port = makeTerminatingBackend('X') - const client = new helper.pg.Client({ ssl: 'require', port }) + const client = new helper.pg.Client({ ssl: 'require', host: 'localhost', port }) // since there was a connection error the client's socket should be closed // and the event loop will have no refs and exit cleanly client.connect((err) => {