@@ -172,7 +172,7 @@ test('libpq connection string building', function () {
172
172
)
173
173
} )
174
174
175
- test ( 'builds conn string with options' , function ( ) {
175
+ test ( 'builds conn string with options and statement_timeout ' , function ( ) {
176
176
var config = {
177
177
user : 'brian' ,
178
178
password : 'xyz' ,
@@ -181,13 +181,33 @@ test('libpq connection string building', function () {
181
181
database : 'bam' ,
182
182
statement_timeout : 5000 ,
183
183
idle_in_transaction_session_timeout : 5000 ,
184
+ options : '-c geqo=off -c foobar=off' ,
184
185
}
185
186
var subject = new ConnectionParameters ( config )
186
187
subject . getLibpqConnectionString (
187
188
assert . calls ( function ( err , constring ) {
188
189
assert ( ! err )
189
190
var parts = constring . split ( / (? = ( [ ^ \' ] * \' [ ^ \' ] * \' ) * [ ^ \' ] * $ ) / )
190
- checkForPart ( parts , "options='-c statement_timeout=5000 -c idle_in_transaction_session_timeout=5000'" )
191
+ checkForPart ( parts , "options='-c statement_timeout=5000 -c idle_in_transaction_session_timeout=5000 -c geqo=off -c foobar=off'" )
192
+ } )
193
+ )
194
+ } )
195
+
196
+ test ( 'builds conn string with options and without statement_timeout' , function ( ) {
197
+ var config = {
198
+ user : 'brian' ,
199
+ password : 'xyz' ,
200
+ port : 888 ,
201
+ host : 'localhost' ,
202
+ database : 'bam' ,
203
+ options : '-c geqo=off -c foobar=off' ,
204
+ }
205
+ var subject = new ConnectionParameters ( config )
206
+ subject . getLibpqConnectionString (
207
+ assert . calls ( function ( err , constring ) {
208
+ assert ( ! err )
209
+ var parts = constring . split ( / (? = ( [ ^ \' ] * \' [ ^ \' ] * \' ) * [ ^ \' ] * $ ) / )
210
+ checkForPart ( parts , "options='-c geqo=off -c foobar=off'" )
191
211
} )
192
212
)
193
213
} )
0 commit comments