@@ -18,19 +18,23 @@ vi.mock("../../i18n", () => ({
1818} ) )
1919
2020vi . mock ( "vscode" , ( ) => ( {
21- CodeAction : vi . fn ( ) . mockImplementation ( ( title , kind ) => ( {
22- title,
23- kind,
24- command : undefined ,
25- } ) ) ,
21+ CodeAction : vi . fn ( ) . mockImplementation ( function ( title , kind ) {
22+ return {
23+ title,
24+ kind,
25+ command : undefined ,
26+ }
27+ } ) ,
2628 CodeActionKind : {
2729 QuickFix : { value : "quickfix" } ,
2830 RefactorRewrite : { value : "refactor.rewrite" } ,
2931 } ,
30- Range : vi . fn ( ) . mockImplementation ( ( startLine , startChar , endLine , endChar ) => ( {
31- start : { line : startLine , character : startChar } ,
32- end : { line : endLine , character : endChar } ,
33- } ) ) ,
32+ Range : vi . fn ( ) . mockImplementation ( function ( startLine , startChar , endLine , endChar ) {
33+ return {
34+ start : { line : startLine , character : startChar } ,
35+ end : { line : endLine , character : endChar } ,
36+ }
37+ } ) ,
3438 DiagnosticSeverity : {
3539 Error : 0 ,
3640 Warning : 1 ,
@@ -78,7 +82,9 @@ describe("CodeActionProvider", () => {
7882 } )
7983 ; ( EditorUtils . getFilePath as Mock ) . mockReturnValue ( "/test/file.ts" )
8084 ; ( EditorUtils . hasIntersectingRange as Mock ) . mockReturnValue ( true )
81- ; ( EditorUtils . createDiagnosticData as Mock ) . mockImplementation ( ( d ) => d )
85+ ; ( EditorUtils . createDiagnosticData as Mock ) . mockImplementation ( ( d ) => {
86+ return d
87+ } )
8288 } )
8389
8490 describe ( "provideCodeActions" , ( ) => {
@@ -127,15 +133,15 @@ describe("CodeActionProvider", () => {
127133 } )
128134
129135 it ( "should handle errors gracefully" , ( ) => {
130- const consoleErrorSpy = vi . spyOn ( console , "error" ) . mockImplementation ( ( ) => { } )
136+ const consoleErrorSpy = vi . spyOn ( console , "error" ) . mockImplementation ( function ( ) { } )
131137
132138 // Reset the workspace mock to return true for enableCodeActions
133139 const mockGet = vi . fn ( ) . mockReturnValue ( true )
134140 const mockGetConfiguration = vi . fn ( ) . mockReturnValue ( {
135141 get : mockGet ,
136142 } )
137143 ; ( vscode . workspace . getConfiguration as Mock ) . mockReturnValue ( mockGetConfiguration ( ) )
138- ; ( EditorUtils . getEffectiveRange as Mock ) . mockImplementation ( ( ) => {
144+ ; ( EditorUtils . getEffectiveRange as Mock ) . mockImplementation ( function ( ) {
139145 throw new Error ( "Test error" )
140146 } )
141147
0 commit comments