node-postgres/packages/pg/test/integration/client/connection-parameter-tests.js
Brian C daeafe82b4
Make tests pass in github codespaces (#2437)
* Make tests pass in github codespaces

There were a few tests which didn't specify a host or port which wasn't working well inside the codespaces docker environment.  Added host & port where required.  Also noticed one test wasn't actually _testing_, it was just `console.log`-ing its output, so I added proper assertions there.  Finally set `PGTESTNOSSL: true` in the codespaces environment until I can get the postgres docker container configured w/ SSL...which I will do l8r.

* lint
2020-12-30 04:20:20 -06:00

16 lines
516 B
JavaScript

const assert = require('assert')
const helper = require('../test-helper')
const suite = new helper.Suite()
const { Client } = helper.pg
suite.test('it sends options', async () => {
const client = new Client({
options: '--default_transaction_isolation=serializable',
})
await client.connect()
const { rows } = await client.query('SHOW default_transaction_isolation')
assert.strictEqual(rows.length, 1)
assert.strictEqual(rows[0].default_transaction_isolation, 'serializable')
await client.end()
})