Skip to content

Commit

Permalink
Merge branch 'swiftlang:main' into plugin_command
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-weng authored Dec 4, 2024
2 parents 02d654a + bc430fe commit debe94b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions test/integration-tests/commands/dependency.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ import { FolderContext } from "../../../src/FolderContext";
import { WorkspaceContext } from "../../../src/WorkspaceContext";
import * as sinon from "sinon";
import { Commands } from "../../../src/commands";
import {
activateExtensionForSuite,
activateExtensionForTest,
folderInRootWorkspace,
} from "../utilities/testutilities";
import { activateExtensionForSuite, folderInRootWorkspace } from "../utilities/testutilities";

suite("Dependency Commmands Test Suite", function () {
// full workflow's interaction with spm is longer than the default timeout
Expand Down Expand Up @@ -82,7 +78,7 @@ suite("Dependency Commmands Test Suite", function () {
let treeProvider: PackageDependenciesProvider;
let item: PackageNode;

activateExtensionForTest({
activateExtensionForSuite({
async setup(ctx) {
// Check before each test case start:
// Expect to fail without setting up local version
Expand Down Expand Up @@ -111,13 +107,14 @@ suite("Dependency Commmands Test Suite", function () {
// Contract: spm edit with user supplied local version of dependency
const windowMock = sinon.stub(vscode.window, "showOpenDialog");
windowMock.resolves([testAssetUri("Swift-Markdown")]);
const result = await vscode.commands.executeCommand(
Commands.USE_LOCAL_DEPENDENCY,
item
);
let result = await vscode.commands.executeCommand(Commands.USE_LOCAL_DEPENDENCY, item);
expect(result).to.be.true;
windowMock.restore();

// Make sure new dependencies resolve before building
result = await vscode.commands.executeCommand(Commands.RESOLVE_DEPENDENCIES);
expect(result).to.be.true;

// This will now pass as we have the required library
const { exitCode, output } = await executeTaskAndWaitForResult(tasks);
expect(exitCode, `${output}`).to.equal(0);
Expand Down

0 comments on commit debe94b

Please sign in to comment.