File tree Expand file tree Collapse file tree 3 files changed +50
-2
lines changed
packages/@dcl/sdk-commands/src/commands/start
test/sdk-commands/commands/start Expand file tree Collapse file tree 3 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ async function runApp(
4646 const skipAuthScreen = ! ! args [ '--skip-auth-screen' ]
4747 const landscapeTerrainEnabled = ! ! args [ '--landscape-terrain-enabled' ]
4848 const openDeeplinkInNewInstance = ! ! args [ '-n' ]
49+ const multiInstance = ! ! args [ '--multi-instance' ]
4950
5051 try {
5152 if ( isWindows ) {
@@ -74,6 +75,9 @@ async function runApp(
7475 if ( openDeeplinkInNewInstance ) {
7576 params . set ( 'open-deeplink-in-new-instance' , 'true' )
7677 }
78+ if ( multiInstance ) {
79+ params . set ( 'multi-instance' , 'true' )
80+ }
7781
7882 const queryParams = params . toString ( )
7983
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ export const args = declareArgs({
6666 '--skip-auth-screen' : Boolean ,
6767 '--landscape-terrain-enabled' : Boolean ,
6868 '-n' : Boolean ,
69- '--bevy-web' : Boolean
69+ '--bevy-web' : Boolean ,
70+ '--multi-instance' : Boolean
7071} )
7172
7273export async function help ( options : Options ) {
@@ -93,7 +94,8 @@ export async function help(options: Options) {
9394 --landscape-terrain-enabled Enable landscape terrain.
9495 -n Open a new instance of the Client even if one is already running.
9596 --bevy-web Opens preview using the Bevy Web browser window.
96- --mobile Show QR code for mobile preview on the same network
97+ --mobile Show QR code for mobile preview on the same network.
98+ --multi-instance Allow running multiple Explorer instances simultaneously.
9799
98100
99101 Examples:
Original file line number Diff line number Diff line change @@ -143,6 +143,48 @@ describe('explorer-alpha', () => {
143143 } )
144144 } )
145145
146+ describe ( 'multiInstance parameter' , ( ) => {
147+ it ( 'should include multi-instance parameter when --multi-instance flag is provided' , async ( ) => {
148+ const args : any = {
149+ '--multi-instance' : true
150+ }
151+
152+ await runExplorerAlpha ( mockComponents , {
153+ cwd : '/test' ,
154+ realm : 'test-realm' ,
155+ baseCoords : { x : 0 , y : 0 } ,
156+ isHub : false ,
157+ args
158+ } )
159+
160+ expect ( mockExec ) . toHaveBeenCalledWith (
161+ '/test' ,
162+ 'open' ,
163+ expect . arrayContaining ( [ expect . stringContaining ( 'multi-instance=true' ) ] ) ,
164+ { silent : true }
165+ )
166+ } )
167+
168+ it ( 'should not include multi-instance parameter when --multi-instance flag is not provided' , async ( ) => {
169+ const args : any = { }
170+
171+ await runExplorerAlpha ( mockComponents , {
172+ cwd : '/test' ,
173+ realm : 'test-realm' ,
174+ baseCoords : { x : 0 , y : 0 } ,
175+ isHub : false ,
176+ args
177+ } )
178+
179+ expect ( mockExec ) . toHaveBeenCalledWith (
180+ '/test' ,
181+ 'open' ,
182+ expect . arrayContaining ( [ expect . not . stringContaining ( 'multi-instance' ) ] ) ,
183+ { silent : true }
184+ )
185+ } )
186+ } )
187+
146188 describe ( 'URL parameter construction' , ( ) => {
147189 it ( 'should construct URL with all parameters correctly' , async ( ) => {
148190 const args : any = {
You can’t perform that action at this time.
0 commit comments