This repository was archived by the owner on Sep 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,16 @@ function getIsPortTaken(config: JestProcessManagerOptions) {
133133 } )
134134}
135135
136+ const basePathUrlPostfix = ( basePath ?: string ) : string => {
137+ if ( basePath ) {
138+ if ( basePath . includes ( '/' ) ) {
139+ return basePath
140+ }
141+ return `/${ basePath } `
142+ }
143+ return ''
144+ }
145+
136146export async function setup ( providedConfigs : JestProcessManagerOptions | JestProcessManagerOptions [ ] ) : Promise < void > {
137147 // Compatible with older versions
138148 const configs = Array . isArray ( providedConfigs )
@@ -209,11 +219,13 @@ async function setupJestServer(providedConfig: JestProcessManagerOptions, index:
209219 runServer ( config , index )
210220 }
211221
222+ const urlPostfix = basePathUrlPostfix ( basePath )
223+
212224 let url = ''
213225 if ( protocol === 'tcp' || protocol === 'socket' ) {
214- url = `${ protocol } :${ host } :${ port } ${ basePath ? `/ ${ basePath } ` : '' } `
226+ url = `${ protocol } :${ host } :${ port } ${ urlPostfix } `
215227 } else {
216- url = `${ protocol } ://${ host } :${ port } ${ basePath ? `/ ${ basePath } ` : '' } `
228+ url = `${ protocol } ://${ host } :${ port } ${ urlPostfix } `
217229 }
218230 const opts = {
219231 resources : [ url ] ,
You can’t perform that action at this time.
0 commit comments