@@ -27,13 +27,13 @@ const baseURI = 'postgres://username:password@localhost:5432/db-name';
27
27
const testfile = fs . readFileSync ( './Dockerfile' ) . toString ( ) ;
28
28
const dbOptionsTest = { } ;
29
29
dbOptionsTest [
30
- `${ baseURI } ?ssl=true&binary=true&application_name=app_name&fallback_application_name=f_app_name&poolSize=10 `
30
+ `${ baseURI } ?ssl=true&binary=true&application_name=app_name&fallback_application_name=f_app_name&poolSize=12 `
31
31
] = {
32
32
ssl : true ,
33
33
binary : true ,
34
34
application_name : 'app_name' ,
35
35
fallback_application_name : 'f_app_name' ,
36
- poolSize : 10 ,
36
+ max : 12 ,
37
37
} ;
38
38
dbOptionsTest [ `${ baseURI } ?ssl=&binary=aa` ] = {
39
39
binary : false ,
@@ -83,6 +83,20 @@ describe('PostgresConfigParser.getDatabaseOptionsFromURI', () => {
83
83
it ( 'sets the poolSize to 10 if the it is not a number' , ( ) => {
84
84
const result = parser . getDatabaseOptionsFromURI ( `${ baseURI } ?poolSize=sdf` ) ;
85
85
86
- expect ( result . poolSize ) . toEqual ( 10 ) ;
86
+ expect ( result . max ) . toEqual ( 10 ) ;
87
+ } ) ;
88
+
89
+ it ( 'sets the max to 10 if the it is not a number' , ( ) => {
90
+ const result = parser . getDatabaseOptionsFromURI ( `${ baseURI } ?&max=sdf` ) ;
91
+
92
+ expect ( result . poolSize ) . toBeUndefined ( ) ;
93
+ expect ( result . max ) . toEqual ( 10 ) ;
94
+ } ) ;
95
+
96
+ it ( 'max should take precedence over poolSize' , ( ) => {
97
+ const result = parser . getDatabaseOptionsFromURI ( `${ baseURI } ?poolSize=20&max=12` ) ;
98
+
99
+ expect ( result . poolSize ) . toBeUndefined ( ) ;
100
+ expect ( result . max ) . toEqual ( 12 ) ;
87
101
} ) ;
88
102
} ) ;
0 commit comments