@@ -11,7 +11,7 @@ describe('FileSystemErrorHandler', () => {
1111 } ) ;
1212
1313 it ( 'should handle permission denied errors' , ( ) => {
14- const error = new Error ( 'Permission denied' ) as any ;
14+ const error = new Error ( 'Permission denied' ) as Error & { code : FileSystemErrorCode } ;
1515 error . code = FileSystemErrorCode . PERMISSION_DENIED ;
1616
1717 const result = FileSystemErrorHandler . handleError ( error , mockOperation , mockFilePath ) ;
@@ -29,7 +29,7 @@ describe('FileSystemErrorHandler', () => {
2929 } ) ;
3030
3131 it ( 'should handle file not found errors' , ( ) => {
32- const error = new Error ( 'File not found' ) as any ;
32+ const error = new Error ( 'File not found' ) as Error & { code : FileSystemErrorCode } ;
3333 error . code = FileSystemErrorCode . FILE_NOT_FOUND ;
3434
3535 const result = FileSystemErrorHandler . handleError ( error , mockOperation , mockFilePath ) ;
@@ -47,7 +47,7 @@ describe('FileSystemErrorHandler', () => {
4747 } ) ;
4848
4949 it ( 'should handle directory not found errors' , ( ) => {
50- const error = new Error ( 'Directory not found' ) as any ;
50+ const error = new Error ( 'Directory not found' ) as Error & { code : FileSystemErrorCode } ;
5151 error . code = FileSystemErrorCode . DIRECTORY_NOT_FOUND ;
5252
5353 const result = FileSystemErrorHandler . handleError ( error , mockOperation , mockFilePath ) ;
@@ -59,7 +59,7 @@ describe('FileSystemErrorHandler', () => {
5959 } ) ;
6060
6161 it ( 'should handle no space left on device errors' , ( ) => {
62- const error = new Error ( 'No space left on device' ) as any ;
62+ const error = new Error ( 'No space left on device' ) as Error & { code : FileSystemErrorCode } ;
6363 error . code = FileSystemErrorCode . NO_SPACE_LEFT ;
6464
6565 const result = FileSystemErrorHandler . handleError ( error , mockOperation , mockFilePath ) ;
@@ -75,7 +75,7 @@ describe('FileSystemErrorHandler', () => {
7575 } ) ;
7676
7777 it ( 'should handle read-only file system errors' , ( ) => {
78- const error = new Error ( 'Read-only file system' ) as any ;
78+ const error = new Error ( 'Read-only file system' ) as Error & { code : FileSystemErrorCode } ;
7979 error . code = FileSystemErrorCode . READ_ONLY_FILE_SYSTEM ;
8080
8181 const result = FileSystemErrorHandler . handleError ( error , mockOperation , mockFilePath ) ;
@@ -91,7 +91,7 @@ describe('FileSystemErrorHandler', () => {
9191 } ) ;
9292
9393 it ( 'should handle too many open files errors' , ( ) => {
94- const error = new Error ( 'Too many open files' ) as any ;
94+ const error = new Error ( 'Too many open files' ) as Error & { code : FileSystemErrorCode } ;
9595 error . code = FileSystemErrorCode . TOO_MANY_OPEN_FILES ;
9696
9797 const result = FileSystemErrorHandler . handleError ( error , mockOperation , mockFilePath ) ;
@@ -107,7 +107,7 @@ describe('FileSystemErrorHandler', () => {
107107 } ) ;
108108
109109 it ( 'should handle invalid path errors' , ( ) => {
110- const error = new Error ( 'Invalid path' ) as any ;
110+ const error = new Error ( 'Invalid path' ) as Error & { code : FileSystemErrorCode } ;
111111 error . code = FileSystemErrorCode . INVALID_PATH ;
112112
113113 const result = FileSystemErrorHandler . handleError ( error , mockOperation , mockFilePath ) ;
@@ -154,15 +154,20 @@ describe('FileSystemErrorHandler', () => {
154154 } ) ;
155155
156156 describe ( 'logErrorResult' , ( ) => {
157- let mockLogger : any ;
157+ let mockLogger : {
158+ error : ReturnType < typeof vi . fn > ;
159+ warn : ReturnType < typeof vi . fn > ;
160+ log : ReturnType < typeof vi . fn > ;
161+ } ;
158162
159163 beforeEach ( ( ) => {
160164 mockLogger = {
161165 error : vi . fn ( ) ,
162166 warn : vi . fn ( ) ,
163167 log : vi . fn ( ) ,
164168 } ;
165- ( FileSystemErrorHandler as any ) . logger = mockLogger ;
169+ // Use type assertion to set private static property
170+ ( FileSystemErrorHandler as unknown as { logger : typeof mockLogger } ) . logger = mockLogger ;
166171 } ) ;
167172
168173 it ( 'should log critical errors with suggestions' , ( ) => {
0 commit comments