@@ -8,7 +8,6 @@ import { createHmacSignature } from '@apify/utilities';
88
99import { testRunCommand } from '../../../src/lib/command-framework/apify-command.js' ;
1010import { LOCAL_CONFIG_PATH } from '../../../src/lib/consts.js' ;
11- import { execWithLog } from '../../../src/lib/exec.js' ;
1211import { createSourceFiles , getActorLocalFilePaths , getLocalUserInfo } from '../../../src/lib/utils.js' ;
1312import { testUserClient } from '../../__setup__/config.js' ;
1413import { TEST_TIMEOUT } from '../../__setup__/consts.js' ;
@@ -90,7 +89,7 @@ describe('[api] apify push', () => {
9089 } ;
9190 writeFileSync ( joinPath ( LOCAL_CONFIG_PATH ) , JSON . stringify ( actorJson , null , '\t' ) , { flag : 'w' } ) ;
9291
93- await testRunCommand ( ActorsPushCommand , { flags_force : true } ) ;
92+ await testRunCommand ( ActorsPushCommand , { flags_noPrompt : true , flags_force : true } ) ;
9493
9594 const userInfo = await getLocalUserInfo ( ) ;
9695 const { name } = actorJson ;
@@ -129,6 +128,7 @@ describe('[api] apify push', () => {
129128
130129 await testRunCommand ( ActorsPushCommand , {
131130 args_actorId : testActor . id ,
131+ flags_noPrompt : true ,
132132 flags_force : true ,
133133 } ) ;
134134
@@ -182,7 +182,7 @@ describe('[api] apify push', () => {
182182 delete actorJson . environmentVariables ;
183183 writeFileSync ( joinPath ( LOCAL_CONFIG_PATH ) , JSON . stringify ( actorJson , null , '\t' ) , { flag : 'w' } ) ;
184184
185- await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id } ) ;
185+ await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id , flags_noPrompt : true } ) ;
186186
187187 testActor = ( await testActorClient . get ( ) ) ! ;
188188 const testActorVersion = await testActorClient . version ( actorJson . version ) . get ( ) ;
@@ -229,7 +229,7 @@ describe('[api] apify push', () => {
229229 // Create large file to ensure Actor will be uploaded as zip
230230 writeFileSync ( joinPath ( '3mb-file.txt' ) , Buffer . alloc ( 1024 * 1024 * 3 ) ) ;
231231
232- await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id } ) ;
232+ await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id , flags_noPrompt : true } ) ;
233233
234234 // Remove the big file so sources in following tests are not zipped
235235 unlinkSync ( joinPath ( '3mb-file.txt' ) ) ;
@@ -275,7 +275,7 @@ describe('[api] apify push', () => {
275275
276276 writeFileSync ( joinPath ( 'some-typescript-file.ts' ) , `console.log('ok');` ) ;
277277
278- await testRunCommand ( ActorsPushCommand , { flags_force : true } ) ;
278+ await testRunCommand ( ActorsPushCommand , { flags_noPrompt : true , flags_force : true } ) ;
279279
280280 if ( existsSync ( joinPath ( 'some-typescript-file.ts' ) ) ) unlinkSync ( joinPath ( 'some-typescript-file.ts' ) ) ;
281281
@@ -307,7 +307,7 @@ describe('[api] apify push', () => {
307307 // @ts -expect-error Wrong typing of update method
308308 await testActorClient . version ( actorJson . version ) . update ( { buildTag : 'beta' } ) ;
309309
310- await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id } ) ;
310+ await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id , flags_noPrompt : true } ) ;
311311 if ( testActor ) await testActorClient . delete ( ) ;
312312
313313 expect ( lastErrorMessage ( ) ) . to . includes ( 'is already on the platform' ) ;
@@ -325,7 +325,7 @@ describe('[api] apify push', () => {
325325 actorJson . description = 'This is a custom description for the actor.' ;
326326
327327 writeFileSync ( joinPath ( LOCAL_CONFIG_PATH ) , JSON . stringify ( actorJson , null , '\t' ) , { flag : 'w' } ) ;
328- await testRunCommand ( ActorsPushCommand , { flags_force : true } ) ;
328+ await testRunCommand ( ActorsPushCommand , { flags_noPrompt : true , flags_force : true } ) ;
329329
330330 const userInfo = await getLocalUserInfo ( ) ;
331331 const actorId = `${ userInfo . username } /${ actorJson . name } ` ;
@@ -359,7 +359,7 @@ describe('[api] apify push', () => {
359359 delete actorJson . description ;
360360 writeFileSync ( joinPath ( LOCAL_CONFIG_PATH ) , JSON . stringify ( actorJson , null , '\t' ) , { flag : 'w' } ) ;
361361
362- await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id } ) ;
362+ await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id , flags_noPrompt : true } ) ;
363363
364364 testActor = ( await testActorClient . get ( ) ) ! ;
365365
@@ -381,7 +381,7 @@ describe('[api] apify push', () => {
381381
382382 forceNewCwd ( 'empty-dir' ) ;
383383
384- await testRunCommand ( ActorsPushCommand , { } ) ;
384+ await testRunCommand ( ActorsPushCommand , { flags_noPrompt : true } ) ;
385385
386386 expect ( lastErrorMessage ( ) ) . to . include (
387387 'You need to call this command from a folder that has an Actor in it' ,
@@ -401,13 +401,7 @@ describe('[api] apify push', () => {
401401
402402 await writeFile ( joinCwdPath ( 'owo.txt' ) , 'Lorem ipsum' ) ;
403403
404- await execWithLog ( {
405- cmd : 'git' ,
406- args : [ 'init' ] ,
407- opts : { cwd : joinCwdPath ( ) } ,
408- } ) ;
409-
410- await testRunCommand ( ActorsPushCommand , { } ) ;
404+ await testRunCommand ( ActorsPushCommand , { flags_noPrompt : true } ) ;
411405
412406 expect ( lastErrorMessage ( ) ) . to . include ( 'A valid Actor could not be found in the current directory.' ) ;
413407 } ,
0 commit comments