File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
packages/mongodb-memory-server-core/src/util Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ export class DryMongoBinary {
160160 log ( `parseArchiveNameRegex (input: "${ input } ")` ) ;
161161
162162 const archiveMatches =
163- / m o n g o d b - (?< platform > l i n u x | w i n 3 2 | o s x ) (?: - s s l - | - ) (?< arch > \w { 4 , } ) (?: - (?< dist > \w + ) | ) (?: - s s l - | - ) (?: v | ) (?< version > [ \d . ] + (?: - l a t e s t | ) ) \. / gim. exec (
163+ / m o n g o d b - (?< platform > l i n u x | w i n 3 2 | o s x | m a c o s ) (?: - s s l - | - ) (?< arch > \w { 4 , } ) (?: - (?< dist > \w + ) | ) (?: - s s l - | - ) (?: v | ) (?< version > [ \d . ] + (?: - l a t e s t | ) ) \. / gim. exec (
164164 input
165165 ) ;
166166
Original file line number Diff line number Diff line change @@ -607,6 +607,33 @@ describe('DryBinary', () => {
607607 } ) ;
608608 } ) ;
609609
610+ it ( 'should parse and overwrite input options MACOS with macos in archive name' , async ( ) => {
611+ const input = 'http://downloads.mongodb.org/osx/mongodb-macos-x86_64-5.0.3.tgz' ;
612+ // The following options are made different to check that the function actually changes them
613+ const customos : OtherOS = {
614+ os : 'win32' ,
615+ } ;
616+ const origOptions : Required < binary . DryMongoBinaryOptions > = {
617+ version : '5.0.3' ,
618+ arch : 'arm64' ,
619+ os : customos ,
620+ downloadDir : '/path/to/somewhere' ,
621+ systemBinary : '' ,
622+ } ;
623+
624+ const output = binary . DryMongoBinary . parseArchiveNameRegex ( input , origOptions ) ;
625+
626+ expect ( output ) . toStrictEqual < binary . DryMongoBinaryOptions > ( {
627+ version : '5.0.3' ,
628+ arch : 'x86_64' ,
629+ downloadDir : origOptions . downloadDir ,
630+ systemBinary : '' ,
631+ os : {
632+ os : 'macos' ,
633+ } ,
634+ } ) ;
635+ } ) ;
636+
610637 it ( 'should parse and overwrite input options WINDOWS' , async ( ) => {
611638 const input =
612639 'https://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.25.zip' ;
You can’t perform that action at this time.
0 commit comments