Skip to content

Commit 1b7d018

Browse files
committed
Fix integration test
1 parent ffdb9c1 commit 1b7d018

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/integrationTests/codeActionRename.integration.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,11 @@ suite(`Code Action Rename ${testAssetWorkspace.description}`, function () {
4040

4141
test("Code actions can rename and open files", async () => {
4242
await vscode.commands.executeCommand("vscode.open", fileUri);
43-
let c = await vscode.commands.executeCommand("vscode.executeCodeActionProvider", fileUri, new vscode.Range(0, 7, 0, 7)) as { command: string, title: string, arguments: string[] }[];
44-
let command = c.find(
45-
(s) => { return s.title == "Rename file to C.cs"; }
46-
);
47-
expect(command, "Didn't find rename class command");
43+
const codeActions = await vscode.commands.executeCommand<vscode.CodeAction[]>("vscode.executeCodeActionProvider", fileUri, new vscode.Range(0, 7, 0, 7));
44+
const codeAction = codeActions.find(codeAction => codeAction.title == "Rename file to C.cs");
45+
expect(codeAction, "Didn't find rename class code action");
4846

49-
await vscode.commands.executeCommand(command.command, ...command.arguments);
47+
await vscode.commands.executeCommand(codeAction.command.command, ...codeAction.command.arguments);
5048

5149
await assertWithPoll(() => { }, 15 * 1000, 500, _ => expect(vscode.window.activeTextEditor.document.fileName).contains("C.cs"));
5250
});

0 commit comments

Comments
 (0)