@@ -2,7 +2,6 @@ import net from 'node:net';
22import { EventEmitter } from 'node:events' ;
33
44import type { ToolsLogger } from '@sap-ux/logger' ;
5- import { isAppStudio } from '@sap-ux/btp-utils' ;
65import { ensureTunnelAppExists , enableSshAndRestart } from '@sap-ux/adp-tooling' ;
76import { spawn } from 'node:child_process' ;
87
@@ -14,10 +13,6 @@ jest.mock('node:child_process', () => ({
1413 spawn : jest . fn ( )
1514} ) ) ;
1615
17- jest . mock ( '@sap-ux/btp-utils' , ( ) => ( {
18- isAppStudio : jest . fn ( )
19- } ) ) ;
20-
2116jest . mock ( '@sap-ux/adp-tooling' , ( ) => ( {
2217 ensureTunnelAppExists : jest . fn ( ) ,
2318 enableSshAndRestart : jest . fn ( ) ,
@@ -29,7 +24,6 @@ jest.mock('../../../src/tunnel/destination-check', () => ({
2924} ) ) ;
3025
3126const mockSpawn = spawn as jest . Mock ;
32- const mockIsAppStudio = isAppStudio as jest . Mock ;
3327const mockEnsureTunnel = ensureTunnelAppExists as jest . Mock ;
3428const mockEnableSsh = enableSshAndRestart as jest . Mock ;
3529const mockHasOnPremise = hasOnPremiseDestination as jest . Mock ;
@@ -100,7 +94,6 @@ describe('tunnel', () => {
10094
10195 beforeEach ( ( ) => {
10296 jest . clearAllMocks ( ) ;
103- mockIsAppStudio . mockReturnValue ( false ) ;
10497 processOnSpy = jest . spyOn ( process , 'on' ) ;
10598 processOnceSpy = jest . spyOn ( process , 'once' ) ;
10699 } ) ;
@@ -125,15 +118,6 @@ describe('tunnel', () => {
125118 }
126119
127120 describe ( 'startSshTunnelIfNeeded' , ( ) => {
128- test ( 'should return undefined when running in BAS' , async ( ) => {
129- mockIsAppStudio . mockReturnValue ( true ) ;
130-
131- const result = await startSshTunnelIfNeeded ( connectivityInfo , 'tunnel-app' , logger ) ;
132-
133- expect ( result ) . toBeUndefined ( ) ;
134- expect ( logger . debug ) . toHaveBeenCalledWith ( expect . stringContaining ( 'BAS' ) ) ;
135- } ) ;
136-
137121 test ( 'should return undefined when port is already in use' , async ( ) => {
138122 createServerSpy = jest
139123 . spyOn ( net , 'createServer' )
@@ -254,7 +238,6 @@ describe('tunnel', () => {
254238 test ( 'should deploy tunnel app and start tunnel when OnPremise found' , async ( ) => {
255239 mockHasOnPremise . mockResolvedValue ( true ) ;
256240 mockEnsureTunnel . mockResolvedValue ( undefined ) ;
257- mockIsAppStudio . mockReturnValue ( true ) ;
258241
259242 await setupSshTunnel ( '/root' , connectivityInfo , effectiveOptions , logger ) ;
260243
@@ -264,7 +247,6 @@ describe('tunnel', () => {
264247 test ( 'should use custom tunnelAppName from options' , async ( ) => {
265248 mockHasOnPremise . mockResolvedValue ( true ) ;
266249 mockEnsureTunnel . mockResolvedValue ( undefined ) ;
267- mockIsAppStudio . mockReturnValue ( true ) ;
268250
269251 const opts = { ...effectiveOptions , tunnelAppName : 'custom-app' } as unknown as EffectiveOptions ;
270252 await setupSshTunnel ( '/root' , connectivityInfo , opts , logger ) ;
0 commit comments