Skip to content

Commit 9480cd1

Browse files
committed
Improve skipped test messages
1 parent d29dc6d commit 9480cd1

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,8 @@ public async Task CanLaunchScriptWithNoBreakpointsAsync()
180180
[SkippableFact]
181181
public async Task CanSetBreakpointsAsync()
182182
{
183-
Skip.If(
184-
PsesStdioProcess.RunningInConstrainedLanguageMode,
185-
"You can't set breakpoints in ConstrainedLanguage mode.");
183+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode,
184+
"Breakpoints can't be set in Constrained Language Mode.");
186185

187186
string filePath = NewTestFile(GenerateScriptFromLoggingStatements(
188187
"before breakpoint",
@@ -234,8 +233,10 @@ public async Task CanSetBreakpointsAsync()
234233
[SkippableFact]
235234
public async Task CanStepPastSystemWindowsForms()
236235
{
237-
Skip.IfNot(PsesStdioProcess.IsWindowsPowerShell);
238-
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode);
236+
Skip.IfNot(PsesStdioProcess.IsWindowsPowerShell,
237+
"Windows Forms requires Windows PowerShell.");
238+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode,
239+
"Breakpoints can't be set in Constrained Language Mode.");
239240

240241
string filePath = NewTestFile(string.Join(Environment.NewLine, new[]
241242
{

test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

+12-19
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ function CanSendWorkspaceSymbolRequest {
154154
[SkippableFact]
155155
public async Task CanReceiveDiagnosticsFromFileOpenAsync()
156156
{
157-
Skip.If(
158-
PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
157+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
159158
"Windows PowerShell doesn't trust PSScriptAnalyzer by default so it won't load.");
160159

161160
NewTestFile("$a = 4");
@@ -177,8 +176,7 @@ public async Task WontReceiveDiagnosticsFromFileOpenThatIsNotPowerShellAsync()
177176
[SkippableFact]
178177
public async Task CanReceiveDiagnosticsFromFileChangedAsync()
179178
{
180-
Skip.If(
181-
PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
179+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
182180
"Windows PowerShell doesn't trust PSScriptAnalyzer by default so it won't load.");
183181

184182
string filePath = NewTestFile("$a = 4");
@@ -229,8 +227,7 @@ public async Task CanReceiveDiagnosticsFromFileChangedAsync()
229227
[SkippableFact]
230228
public async Task CanReceiveDiagnosticsFromConfigurationChangeAsync()
231229
{
232-
Skip.If(
233-
PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
230+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
234231
"Windows PowerShell doesn't trust PSScriptAnalyzer by default so it won't load.");
235232

236233
NewTestFile("gci | % { $_ }");
@@ -330,8 +327,7 @@ await PsesLanguageClient
330327
[SkippableFact]
331328
public async Task CanSendFormattingRequestAsync()
332329
{
333-
Skip.If(
334-
PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
330+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
335331
"Windows PowerShell doesn't trust PSScriptAnalyzer by default so it won't load.");
336332

337333
string scriptPath = NewTestFile(@"
@@ -367,8 +363,7 @@ public async Task CanSendFormattingRequestAsync()
367363
[SkippableFact]
368364
public async Task CanSendRangeFormattingRequestAsync()
369365
{
370-
Skip.If(
371-
PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
366+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
372367
"Windows PowerShell doesn't trust PSScriptAnalyzer by default so it won't load.");
373368

374369
string scriptPath = NewTestFile(@"
@@ -891,8 +886,7 @@ function CanSendReferencesCodeLensRequest {
891886
[SkippableFact]
892887
public async Task CanSendCodeActionRequestAsync()
893888
{
894-
Skip.If(
895-
PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
889+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
896890
"Windows PowerShell doesn't trust PSScriptAnalyzer by default so it won't load.");
897891

898892
string filePath = NewTestFile("gci");
@@ -971,7 +965,7 @@ public async Task CanSendCompletionAndCompletionResolveRequestAsync()
971965
Assert.Contains("Writes customized output to a host", updatedCompletionItem.Documentation.String);
972966
}
973967

974-
[SkippableFact(Skip = "This test is too flaky right now.")]
968+
[SkippableFact(Skip = "Completion for Expand-SlowArchive is flaky.")]
975969
public async Task CanSendCompletionResolveWithModulePrefixRequestAsync()
976970
{
977971
await PsesLanguageClient
@@ -1090,7 +1084,8 @@ await PsesLanguageClient
10901084
[SkippableFact]
10911085
public async Task CanSendGetProjectTemplatesRequestAsync()
10921086
{
1093-
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode, "Plaster doesn't work in ConstrainedLanguage mode.");
1087+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode,
1088+
"Plaster doesn't work in Constrained Language Mode.");
10941089

10951090
GetProjectTemplatesResponse getProjectTemplatesResponse =
10961091
await PsesLanguageClient
@@ -1109,8 +1104,7 @@ await PsesLanguageClient
11091104
[SkippableFact]
11101105
public async Task CanSendGetCommentHelpRequestAsync()
11111106
{
1112-
Skip.If(
1113-
PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
1107+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode && PsesStdioProcess.IsWindowsPowerShell,
11141108
"Windows PowerShell doesn't trust PSScriptAnalyzer by default so it won't load.");
11151109

11161110
string scriptPath = NewTestFile(@"
@@ -1180,9 +1174,8 @@ await PsesLanguageClient
11801174
[SkippableFact]
11811175
public async Task CanSendExpandAliasRequestAsync()
11821176
{
1183-
Skip.If(
1184-
PsesStdioProcess.RunningInConstrainedLanguageMode,
1185-
"This feature currently doesn't support ConstrainedLanguage Mode.");
1177+
Skip.If(PsesStdioProcess.RunningInConstrainedLanguageMode,
1178+
"The expand alias request doesn't work in Constrained Language Mode.");
11861179

11871180
ExpandAliasResult expandAliasResult =
11881181
await PsesLanguageClient

0 commit comments

Comments
 (0)