@@ -62,25 +62,6 @@ const mockCore = { debug: vi.fn(), info: vi.fn(), notice: vi.fn(), warning: vi.f
6262 ( expect ( branchNameCall ) . toBeDefined ( ) , expect ( branchNameCall [ 1 ] ) . toBe ( "assets/my-branch" ) ) ;
6363 } ) ;
6464 } ) ,
65- describe ( "legacy upload-assets type handling" , ( ) => {
66- it ( "should warn about legacy upload-assets type (plural hyphenated)" , async ( ) => {
67- ( ( process . env . GH_AW_ASSETS_BRANCH = "assets/test-workflow" ) , ( process . env . GH_AW_SAFE_OUTPUTS_STAGED = "false" ) ) ;
68- const assetDir = "/tmp/gh-aw/safeoutputs/assets" ;
69- fs . existsSync ( assetDir ) || fs . mkdirSync ( assetDir , { recursive : ! 0 } ) ;
70- const assetPath = path . join ( assetDir , "test.png" ) ;
71- fs . writeFileSync ( assetPath , "fake png data" ) ;
72- const crypto = require ( "crypto" ) ,
73- fileContent = fs . readFileSync ( assetPath ) ,
74- agentOutput = {
75- items : [ { type : "upload-assets" , fileName : "test.png" , sha : crypto . createHash ( "sha256" ) . update ( fileContent ) . digest ( "hex" ) , size : fileContent . length , targetFileName : "test.png" , url : "https://example.com/test.png" } ] ,
76- } ;
77- setAgentOutput ( agentOutput ) ;
78- ( mockExec . exec . mockImplementation ( async ( ) => 0 ) , await executeScript ( ) ) ;
79- const warningCalls = mockCore . warning . mock . calls . filter ( call => call [ 0 ] . includes ( "legacy type" ) ) ;
80- ( expect ( warningCalls . length ) . toBeGreaterThan ( 0 ) , expect ( warningCalls [ 0 ] [ 0 ] ) . toContain ( "upload-assets" ) , expect ( warningCalls [ 0 ] [ 0 ] ) . toContain ( "deprecated" ) ) ;
81- fs . existsSync ( assetPath ) && fs . unlinkSync ( assetPath ) ;
82- } ) ;
83- } ) ,
8465 describe ( "branch prefix validation" , ( ) => {
8566 ( it ( "should allow creating orphaned branch with 'assets/' prefix when branch doesn't exist" , async ( ) => {
8667 ( fs . existsSync ( "test.png" ) && fs . unlinkSync ( "test.png" ) , ( process . env . GH_AW_ASSETS_BRANCH = "assets/test-workflow" ) , ( process . env . GH_AW_SAFE_OUTPUTS_STAGED = "false" ) ) ;
0 commit comments