@@ -11,7 +11,7 @@ describe('remove all command', () => {
1111
1212 beforeAll ( async ( ) => {
1313 testDir = join ( tmpdir ( ) , `agentcore-remove-all-${ randomUUID ( ) } ` ) ;
14- // eslint-disable-next-line security/detect-non-literal-fs-filename
14+
1515 await mkdir ( testDir , { recursive : true } ) ;
1616
1717 // Create project with agent
@@ -53,7 +53,7 @@ describe('remove all command', () => {
5353 it ( 'preserves aws-targets.json and deployed-state.json after remove all' , async ( ) => {
5454 // Write aws-targets.json so we can verify it's preserved
5555 const awsTargetsPath = join ( projectDir , 'agentcore' , 'aws-targets.json' ) ;
56- // eslint-disable-next-line security/detect-non-literal-fs-filename
56+
5757 await writeFile (
5858 awsTargetsPath ,
5959 JSON . stringify ( [ { name : 'default' , account : '123456789012' , region : 'us-east-1' } ] )
@@ -62,10 +62,10 @@ describe('remove all command', () => {
6262 // Simulate a deployed state entry so we can verify it is preserved
6363 // deployed-state.json lives in agentcore/.cli/
6464 const cliDir = join ( projectDir , 'agentcore' , '.cli' ) ;
65- // eslint-disable-next-line security/detect-non-literal-fs-filename
65+
6666 await mkdir ( cliDir , { recursive : true } ) ;
6767 const deployedStatePath = join ( cliDir , 'deployed-state.json' ) ;
68- // eslint-disable-next-line security/detect-non-literal-fs-filename
68+
6969 await writeFile (
7070 deployedStatePath ,
7171 JSON . stringify ( { targets : { default : { resources : { stackName : 'TestStack' } } } } )
@@ -78,20 +78,20 @@ describe('remove all command', () => {
7878 expect ( json . success ) . toBe ( true ) ;
7979
8080 // Verify aws-targets.json is preserved (NOT reset to empty)
81- // eslint-disable-next-line security/detect-non-literal-fs-filename
81+
8282 const targetsAfter = JSON . parse ( await readFile ( awsTargetsPath , 'utf-8' ) ) ;
8383 expect ( targetsAfter . length , 'aws-targets.json should be preserved after remove all' ) . toBe ( 1 ) ;
8484
8585 // Verify deployed-state.json is preserved (NOT reset to empty)
86- // eslint-disable-next-line security/detect-non-literal-fs-filename
86+
8787 const deployedStateAfter = JSON . parse ( await readFile ( deployedStatePath , 'utf-8' ) ) ;
8888 expect (
8989 Object . keys ( deployedStateAfter . targets ) . length ,
9090 'deployed-state.json targets should be preserved after remove all'
9191 ) . toBe ( 1 ) ;
9292
9393 // Verify agentcore.json agents ARE cleared
94- // eslint-disable-next-line security/detect-non-literal-fs-filename
94+
9595 const schema = JSON . parse ( await readFile ( join ( projectDir , 'agentcore' , 'agentcore.json' ) , 'utf-8' ) ) ;
9696 expect ( schema . agents . length , 'Agents should be cleared after remove all' ) . toBe ( 0 ) ;
9797 } ) ;
0 commit comments