File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1542,7 +1542,12 @@ describe('connections:', function() {
1542
1542
it ( 'should not throw an error when attempting to mutate unmutable options object gh-13335' , async function ( ) {
1543
1543
const m = new mongoose . Mongoose ( ) ;
1544
1544
const opts = Object . preventExtensions ( { } ) ;
1545
- const conn = await m . connect ( 'mongodb://127.0.0.1:27017/db?retryWrites=true&w=majority&readPreference=primaryPreferred' , opts ) ;
1545
+
1546
+ const uri = start . uri . lastIndexOf ( '?' ) === - 1 ?
1547
+ start . uri + '?retryWrites=true&w=majority&readPreference=primaryPreferred' :
1548
+ start . uri . slice ( 0 , start . uri . lastIndexOf ( '?' ) ) + '?retryWrites=true&w=majority&readPreference=primaryPreferred' ;
1549
+
1550
+ const conn = await m . connect ( uri , opts ) ;
1546
1551
assert . ok ( conn ) ;
1547
1552
} ) ;
1548
1553
} ) ;
You can’t perform that action at this time.
0 commit comments