Skip to content

Commit b76ecc2

Browse files
committed
Rewrite flaky test to use Get-Date instead of Expand-Archive
1 parent c2a10d3 commit b76ecc2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -1057,8 +1057,6 @@ public async Task CanSendCompletionAndCompletionResolveRequestAsync()
10571057
Assert.Contains("Writes customized output to a host", updatedCompletionItem.Documentation.String);
10581058
}
10591059

1060-
1061-
// [SkippableFact(Skip = "Completion for Expand-SlowArchive is flaky.")]
10621060
[Fact]
10631061
public async Task CanSendCompletionResolveWithModulePrefixRequestAsync()
10641062
{
@@ -1067,11 +1065,11 @@ await PsesLanguageClient
10671065
"evaluate",
10681066
new EvaluateRequestArguments
10691067
{
1070-
Expression = "Import-Module Microsoft.PowerShell.Archive -Prefix Slow"
1068+
Expression = "Import-Module Microsoft.PowerShell.Utility -Prefix Test"
10711069
})
10721070
.ReturningVoid(CancellationToken.None);
10731071

1074-
string filePath = NewTestFile("Expand-SlowArch");
1072+
string filePath = NewTestFile("Get-TestDate");
10751073

10761074
CompletionList completionItems = await PsesLanguageClient.TextDocument.RequestCompletion(
10771075
new CompletionParams
@@ -1080,15 +1078,15 @@ await PsesLanguageClient
10801078
{
10811079
Uri = DocumentUri.FromFileSystemPath(filePath)
10821080
},
1083-
Position = new Position(line: 0, character: 15)
1081+
Position = new Position(line: 0, character: 12)
10841082
});
10851083

10861084
CompletionItem completionItem = Assert.Single(completionItems,
1087-
completionItem1 => completionItem1.Label == "Expand-SlowArchive");
1085+
completionItem1 => completionItem1.Label == "Get-TestDate");
10881086

10891087
CompletionItem updatedCompletionItem = await PsesLanguageClient.ResolveCompletion(completionItem);
10901088

1091-
Assert.Contains("Extracts files from a specified archive", updatedCompletionItem.Documentation.String);
1089+
Assert.Contains("Gets the current date and time.", updatedCompletionItem.Documentation.String);
10921090
}
10931091

10941092
[SkippableFact]

0 commit comments

Comments
 (0)