Skip to content

Commit edd0c06

Browse files
committed
Add integration test
1 parent ae62d31 commit edd0c06

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

packages/pg-connection-string/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function parse(str) {
2020
/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str) ? encodeURI(str).replace(/\%25(\d\d)/g, '%$1') : str,
2121
true
2222
)
23+
2324
var config = result.query
2425
for (var k in config) {
2526
if (Array.isArray(config[k])) {

packages/pg-connection-string/test/parse.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ describe('parse', function () {
188188
subject.fallback_application_name.should.equal('TheAppFallback')
189189
})
190190

191-
it('configuration parameter options', function () {
192-
var connectionString = 'pg:///?options=-c geqo=off'
191+
it.only('configuration parameter options', function () {
192+
var connectionString = `pg:///?options=${encodeURIComponent('-c geqo=off')}`
193193
var subject = parse(connectionString)
194194
subject.options.should.equal('-c geqo=off')
195195
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const helper = require('../test-helper')
2+
const suite = new helper.Suite()
3+
const { Client } = helper.pg
4+
5+
suite.test('it sends options', async () => {
6+
const client = new Client({
7+
options: '--default_transaction_isolation=serializable',
8+
})
9+
await client.connect()
10+
const { rows } = await client.query('SHOW default_transaction_isolation')
11+
console.log(rows)
12+
await client.end()
13+
})

0 commit comments

Comments
 (0)