@@ -65,7 +65,7 @@ describe("Config import", () => {
6565 await new ConfigCommandService ( testContext ) . batchImportPackages ( "./export_file.zip" , null , overwrite , null ) ;
6666
6767 const expectedFileName = loggingTestTransport . logMessages [ 0 ] . message . split ( LOG_MESSAGE ) [ 1 ] ;
68- expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" } ) ;
68+ expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" , mode : "0600" } ) ;
6969 } )
7070
7171 it . each ( [
@@ -98,7 +98,7 @@ describe("Config import", () => {
9898 await new ConfigCommandService ( testContext ) . batchImportPackages ( null , null , overwrite , branchName ) ;
9999
100100 const expectedFileName = loggingTestTransport . logMessages [ 0 ] . message . split ( LOG_MESSAGE ) [ 1 ] ;
101- expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" } ) ;
101+ expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" , mode : "0600" } ) ;
102102 } )
103103
104104 it . each ( [
@@ -137,7 +137,7 @@ describe("Config import", () => {
137137 await new ConfigCommandService ( testContext ) . batchImportPackages ( null , null , overwrite , branchName ) ;
138138
139139 const expectedFileName = loggingTestTransport . logMessages [ 0 ] . message . split ( LOG_MESSAGE ) [ 1 ] ;
140- expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" } ) ;
140+ expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" , mode : "0600" } ) ;
141141 } )
142142
143143 it ( "Should batch import configs & map space ID as specified in manifest file for Studio Packages" , async ( ) => {
@@ -181,7 +181,7 @@ describe("Config import", () => {
181181 await new ConfigCommandService ( testContext ) . batchImportPackages ( "./export_file.zip" , null , true , null ) ;
182182
183183 const expectedFileName = loggingTestTransport . logMessages [ 0 ] . message . split ( LOG_MESSAGE ) [ 1 ] ;
184- expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" } ) ;
184+ expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" , mode : "0600" } ) ;
185185 } )
186186
187187 it ( "Should fail to map space ID as the space id specified in manifest file cannot be found" , async ( ) => {
@@ -252,7 +252,7 @@ describe("Config import", () => {
252252
253253 await new ConfigCommandService ( testContext ) . batchImportPackages ( "./export_file.zip" , null , true , null ) ;
254254 const expectedFileName = loggingTestTransport . logMessages [ 0 ] . message . split ( LOG_MESSAGE ) [ 1 ] ;
255- expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" } ) ;
255+ expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" , mode : "0600" } ) ;
256256 expect ( mockedAxiosInstance . put ) . toHaveBeenCalledWith ( "https://myTeam.celonis.cloud/package-manager/api/packages/node-id/move/spaceId" , expect . anything ( ) , expect . anything ( ) ) ;
257257 } )
258258
@@ -290,7 +290,7 @@ describe("Config import", () => {
290290 await new ConfigCommandService ( testContext ) . batchImportPackages ( "./export_file.zip" , null , true , null ) ;
291291
292292 const expectedFileName = loggingTestTransport . logMessages [ 0 ] . message . split ( LOG_MESSAGE ) [ 1 ] ;
293- expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" } ) ;
293+ expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" , mode : "0600" } ) ;
294294 expect ( mockedAxiosInstance . put ) . not . toHaveBeenCalledWith ( "https://myTeam.celonis.cloud/package-manager/api/spaces" , expect . anything ( ) , expect . anything ( ) ) ;
295295 } )
296296
@@ -337,7 +337,7 @@ describe("Config import", () => {
337337 await new ConfigCommandService ( testContext ) . batchImportPackages ( "./export_file.zip" , null , true , null ) ;
338338
339339 const expectedFileName = loggingTestTransport . logMessages [ 0 ] . message . split ( LOG_MESSAGE ) [ 1 ] ;
340- expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" } ) ;
340+ expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" , mode : "0600" } ) ;
341341 expect ( mockedAxiosInstance . put ) . not . toHaveBeenCalledWith ( "https://myTeam.celonis.cloud/package-manager/api/spaces" , expect . anything ( ) , expect . anything ( ) ) ;
342342 } )
343343
@@ -416,7 +416,7 @@ describe("Config import", () => {
416416 await new ConfigCommandService ( testContext ) . batchImportPackages ( "./export_file.zip" , null , true , null ) ;
417417
418418 const expectedFileName = loggingTestTransport . logMessages [ 0 ] . message . split ( LOG_MESSAGE ) [ 1 ] ;
419- expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" } ) ;
419+ expect ( mockWriteFileSync ) . toHaveBeenCalledWith ( path . resolve ( process . cwd ( ) , expectedFileName ) , JSON . stringify ( importResponse ) , { encoding : "utf-8" , mode : "0600" } ) ;
420420
421421 expect ( mockedPostRequestBodyByUrl . get ( assignVariablesUrl ) ) . toEqual ( JSON . stringify ( [ variableAssignment ] ) ) ;
422422 } )
0 commit comments