Skip to content

Commit d08b0cc

Browse files
committed
Add end-to-end Pester unit test
1 parent 8738797 commit d08b0cc

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

44
using System;
@@ -294,5 +294,31 @@ public async Task CanLaunchScriptWithCommentedLastLineAsync()
294294

295295
Assert.Collection(GetLog(), (i) => Assert.Equal("a log statement", i));
296296
}
297+
298+
[Fact]
299+
public async Task CanRunPesterTestFile()
300+
{
301+
string logStatement = GenerateScriptFromLoggingStatements("works");
302+
string filePath = NewTestFile(@"
303+
Describe 'A' {
304+
Context 'B' {
305+
It 'C' {
306+
throw 'error'
307+
}
308+
It 'D' {
309+
" + logStatement + @"
310+
}
311+
}
312+
}
313+
");
314+
315+
await PsesDebugAdapterClient.LaunchScript(filePath, Started).ConfigureAwait(false);
316+
317+
ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient.RequestConfigurationDone(new ConfigurationDoneArguments()).ConfigureAwait(false);
318+
Assert.NotNull(configDoneResponse);
319+
await Task.Delay(2000).ConfigureAwait(false);
320+
321+
Assert.Collection(GetLog(), (i) => Assert.Equal("works", i));
322+
}
297323
}
298324
}

0 commit comments

Comments
 (0)