@@ -953,6 +953,39 @@ getInfoPerOS().forEach(([osName, osType, path]) => {
953
953
} ) ;
954
954
} ) ;
955
955
956
+ test ( 'Preserve serverReadyAction when already defined in configuration' , async ( ) => {
957
+ const pythonPath = `PythonPath_${ new Date ( ) . toString ( ) } ` ;
958
+ const workspaceFolder = createMoqWorkspaceFolder ( __dirname ) ;
959
+ const pythonFile = 'xyz.py' ;
960
+ setupIoc ( pythonPath ) ;
961
+ setupActiveEditor ( pythonFile , PYTHON_LANGUAGE ) ;
962
+
963
+ const customServerReadyAction = {
964
+ pattern : '.*Running on (http://\\S+:[0-9]+).*' ,
965
+ uriFormat : '%s/custom' ,
966
+ action : 'debugWithChrome' ,
967
+ } ;
968
+
969
+ testsForautoStartBrowser . forEach ( async ( testParams ) => {
970
+ const debugConfig = await resolveDebugConfiguration ( workspaceFolder , {
971
+ ...launch ,
972
+ ...testParams ,
973
+ serverReadyAction : customServerReadyAction ,
974
+ } ) ;
975
+
976
+ expect ( debugConfig ) . to . have . property ( 'serverReadyAction' , customServerReadyAction ) ;
977
+ if ( ! debugConfig ) {
978
+ throw new Error ( 'Debug config is undefined' ) ;
979
+ }
980
+ expect ( debugConfig . serverReadyAction ) . to . deep . equal ( customServerReadyAction ) ;
981
+ expect ( debugConfig . serverReadyAction ) . to . not . deep . equal ( {
982
+ pattern : '.*(https?:\\/\\/\\S+:[0-9]+\\/?).*' ,
983
+ uriFormat : '%s' ,
984
+ action : 'openExternally' ,
985
+ } ) ;
986
+ } ) ;
987
+ } ) ;
988
+
956
989
test ( 'Send consoleName value to debugpy as consoleTitle' , async ( ) => {
957
990
const consoleName = 'My Console Name' ;
958
991
const pythonPath = `PythonPath_${ new Date ( ) . toString ( ) } ` ;
0 commit comments