@@ -2457,12 +2457,14 @@ Actual: ${stringify(fullActual)}`);
24572457 this . verifyRangeIs ( expectedText , includeWhiteSpace ) ;
24582458 }
24592459
2460- public verifyCodeFixAll ( options : FourSlashInterface . VerifyCodeFixAllOptions ) : void {
2461- const { fixId, newFileContent } = options ;
2462- const fixIds = ts . mapDefined ( this . getCodeFixes ( this . activeFile . fileName ) , a => a . fixId ) ;
2463- ts . Debug . assert ( ts . contains ( fixIds , fixId ) , "No available code fix has that group id." , ( ) => `Expected '${ fixId } '. Available action ids: ${ fixIds } ` ) ;
2460+ public verifyCodeFixAll ( { fixId, fixAllDescription, newFileContent, commands : expectedCommands } : FourSlashInterface . VerifyCodeFixAllOptions ) : void {
2461+ const fixWithId = ts . find ( this . getCodeFixes ( this . activeFile . fileName ) , a => a . fixId === fixId ) ;
2462+ ts . Debug . assert ( fixWithId !== undefined , "No available code fix has that group id." , ( ) =>
2463+ `Expected '${ fixId } '. Available action ids: ${ ts . mapDefined ( this . getCodeFixes ( this . activeFile . fileName ) , a => a . fixId ) } ` ) ;
2464+ ts . Debug . assertEqual ( fixWithId . fixAllDescription , fixAllDescription ) ;
2465+
24642466 const { changes, commands } = this . languageService . getCombinedCodeFix ( { type : "file" , fileName : this . activeFile . fileName } , fixId , this . formatCodeSettings , ts . defaultPreferences ) ;
2465- assert . deepEqual ( commands , options . commands ) ;
2467+ assert . deepEqual ( commands , expectedCommands ) ;
24662468 assert ( changes . every ( c => c . fileName === this . activeFile . fileName ) , "TODO: support testing codefixes that touch multiple files" ) ;
24672469 this . applyChanges ( changes ) ;
24682470 this . verifyCurrentFileContent ( newFileContent ) ;
@@ -4661,6 +4663,7 @@ namespace FourSlashInterface {
46614663
46624664 export interface VerifyCodeFixAllOptions {
46634665 fixId : string ;
4666+ fixAllDescription : string ;
46644667 newFileContent : string ;
46654668 commands : ReadonlyArray < { } > ;
46664669 }
0 commit comments