From aa796c9415649f75ec3a6822548d6b47e3008428 Mon Sep 17 00:00:00 2001 From: "Michael (SPG) Weng" Date: Thu, 21 Nov 2024 15:57:02 -0500 Subject: [PATCH] Test spm update on a simple default package - The spm update command is not stable when used alongside with spm edit, so let's just keep things simple by running the command on defaultPackage instead. --- .../commands/dependency.test.ts | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/test/integration-tests/commands/dependency.test.ts b/test/integration-tests/commands/dependency.test.ts index b5d536e63..0e2418b5d 100644 --- a/test/integration-tests/commands/dependency.test.ts +++ b/test/integration-tests/commands/dependency.test.ts @@ -36,7 +36,27 @@ suite("Dependency Commmands Test Suite", function () { // 15 seconds for each test should be more than enough this.timeout(15 * 1000); - suite("spm Resolve Update Contract Tests", function () { + suite("spm Update Contract Tests", function () { + let folderContext: FolderContext; + let workspaceContext: WorkspaceContext; + + activateExtensionForSuite({ + async setup(ctx) { + workspaceContext = ctx; + await waitForNoRunningTasks(); + folderContext = await folderInRootWorkspace("defaultPackage", workspaceContext); + await workspaceContext.focusFolder(folderContext); + }, + }); + + test("Contract: spm update", async function () { + // Contract: spm update + const result = await vscode.commands.executeCommand(Commands.UPDATE_DEPENDENCIES); + expect(result).to.be.true; + }); + }); + + suite("spm Resolve Contract Tests", function () { let folderContext: FolderContext; let workspaceContext: WorkspaceContext; @@ -132,19 +152,5 @@ suite("Dependency Commmands Test Suite", function () { await assertDependencyNoLongerExists(); }); - - test("Contract: spm update", async function () { - // Contract: spm update - let result = await vscode.commands.executeCommand(Commands.UPDATE_DEPENDENCIES); - expect(result).to.be.true; - - await useLocalDependencyTest(); - - // Clean up - result = await vscode.commands.executeCommand(Commands.UNEDIT_DEPENDENCY, item); - expect(result).to.be.true; - - await assertDependencyNoLongerExists(); - }); }); });