@@ -8,6 +8,7 @@ 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' ;
1112import { createSourceFiles , getActorLocalFilePaths , getLocalUserInfo } from '../../../src/lib/utils.js' ;
1213import { testUserClient } from '../../__setup__/config.js' ;
1314import { TEST_TIMEOUT } from '../../__setup__/consts.js' ;
@@ -89,7 +90,7 @@ describe('[api] apify push', () => {
8990 } ;
9091 writeFileSync ( joinPath ( LOCAL_CONFIG_PATH ) , JSON . stringify ( actorJson , null , '\t' ) , { flag : 'w' } ) ;
9192
92- await testRunCommand ( ActorsPushCommand , { flags_noPrompt : true , flags_force : true } ) ;
93+ await testRunCommand ( ActorsPushCommand , { flags_force : true } ) ;
9394
9495 const userInfo = await getLocalUserInfo ( ) ;
9596 const { name } = actorJson ;
@@ -128,7 +129,6 @@ describe('[api] apify push', () => {
128129
129130 await testRunCommand ( ActorsPushCommand , {
130131 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 , flags_noPrompt : true } ) ;
185+ await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id } ) ;
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 , flags_noPrompt : true } ) ;
232+ await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id } ) ;
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_noPrompt : true , flags_force : true } ) ;
278+ await testRunCommand ( ActorsPushCommand , { 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 , flags_noPrompt : true } ) ;
310+ await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id } ) ;
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_noPrompt : true , flags_force : true } ) ;
328+ await testRunCommand ( ActorsPushCommand , { 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 , flags_noPrompt : true } ) ;
362+ await testRunCommand ( ActorsPushCommand , { args_actorId : testActor . id } ) ;
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 , { flags_noPrompt : true } ) ;
384+ await testRunCommand ( ActorsPushCommand , { } ) ;
385385
386386 expect ( lastErrorMessage ( ) ) . to . include (
387387 'You need to call this command from a folder that has an Actor in it' ,
@@ -401,7 +401,13 @@ describe('[api] apify push', () => {
401401
402402 await writeFile ( joinCwdPath ( 'owo.txt' ) , 'Lorem ipsum' ) ;
403403
404- await testRunCommand ( ActorsPushCommand , { flags_noPrompt : true } ) ;
404+ await execWithLog ( {
405+ cmd : 'git' ,
406+ args : [ 'init' ] ,
407+ opts : { cwd : joinCwdPath ( ) } ,
408+ } ) ;
409+
410+ await testRunCommand ( ActorsPushCommand , { } ) ;
405411
406412 expect ( lastErrorMessage ( ) ) . to . include ( 'A valid Actor could not be found in the current directory.' ) ;
407413 } ,
0 commit comments