Skip to content

Commit fa32a1c

Browse files
authored
Await the execution of the run plugin task command (#1559)
We may be checking mock before actually called
1 parent e7de33a commit fa32a1c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/integration-tests/commands/runPluginTask.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,22 @@ import { mockGlobalObject } from "../../MockUtils";
1717
import { expect } from "chai";
1818
import { activateExtensionForSuite, folderInRootWorkspace } from "../utilities/testutilities";
1919
import { Commands } from "../../../src/commands";
20+
import { SwiftOutputChannel } from "../../../src/ui/SwiftOutputChannel";
2021

2122
suite("runPluginTask Test Suite", () => {
2223
const executeCommand = vscode.commands.executeCommand;
2324
const commandsMock = mockGlobalObject(vscode, "commands");
2425

2526
activateExtensionForSuite({
2627
async setup(ctx) {
27-
await folderInRootWorkspace("command-plugin", ctx);
28+
const folder = await folderInRootWorkspace("command-plugin", ctx);
29+
const outputChannel = new SwiftOutputChannel("runPluginTask.tests");
30+
await folder.loadSwiftPlugins(outputChannel);
2831
},
2932
});
3033

3134
test("Executes runTask command", async () => {
32-
executeCommand(Commands.RUN_PLUGIN_TASK);
35+
await executeCommand(Commands.RUN_PLUGIN_TASK);
3336

3437
expect(commandsMock.executeCommand).to.have.been.calledOnceWith(
3538
"workbench.action.tasks.runTask",

0 commit comments

Comments
 (0)