File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const TESTHUB_CONSTANTS = require("./constants");
55const testObservabilityHelper = require ( "../../bin/testObservability/helper/helper" ) ;
66const helper = require ( "../helpers/helper" ) ;
77const accessibilityHelper = require ( "../accessibility-automation/helper" ) ;
8- const { detect } = require ( 'detect-port' ) ;
8+ const detectPort = require ( 'detect-port' ) ;
99
1010
1111const isUndefined = ( value ) => value === undefined || value === null ;
@@ -195,17 +195,18 @@ exports.logBuildError = (error, product = "") => {
195195 }
196196} ;
197197
198- exports . findAvailablePort = async ( preferredPort , maxAttempts = 10 ) => {
198+ exports . findAvailablePort = async ( preferredPort , maxAttempts = 10 ) => {
199+ const findPort = detectPort . detect || detectPort ;
199200 let port = preferredPort ;
200201 for ( let attempts = 0 ; attempts < maxAttempts ; attempts ++ ) {
201202 try {
202- const availablePort = await detect ( port ) ;
203+ const availablePort = await findPort ( port ) ;
203204
204205 if ( availablePort === port ) {
205206 return port ;
206207 } else {
207208 // Double-check suggested port
208- const verify = await detect ( availablePort ) ;
209+ const verify = await findPort ( availablePort ) ;
209210 if ( verify === availablePort ) {
210211 return availablePort ;
211212 }
You can’t perform that action at this time.
0 commit comments