File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
test/PowerShellEditorServices.Test/Session Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 66using System . Threading ;
77using System . Threading . Tasks ;
88using Microsoft . Extensions . Logging . Abstractions ;
9- using Microsoft . PowerShell . EditorServices . Services . PowerShell . Host ;
109using Microsoft . PowerShell . EditorServices . Services . PowerShell . Console ;
10+ using Microsoft . PowerShell . EditorServices . Services . PowerShell . Execution ;
11+ using Microsoft . PowerShell . EditorServices . Services . PowerShell . Host ;
1112using Xunit ;
1213
1314namespace Microsoft . PowerShell . EditorServices . Test . Console
@@ -41,6 +42,19 @@ public async Task CanExecutePSCommand()
4142 Assert . Equal ( "foo" , result [ 0 ] ) ;
4243 }
4344
45+ [ Fact ] // https://github.com/PowerShell/vscode-powershell/issues/3677
46+ public async Task CanHandleThrow ( )
47+ {
48+ // TODO: Fix this so it doesn't throw!
49+ _ = await Assert . ThrowsAsync < ArgumentOutOfRangeException > ( ( ) =>
50+ {
51+ return psesHost . ExecutePSCommandAsync (
52+ new PSCommand ( ) . AddScript ( "throw" ) ,
53+ CancellationToken . None ,
54+ new PowerShellExecutionOptions { ThrowOnError = false } ) ;
55+ } ) . ConfigureAwait ( true ) ;
56+ }
57+
4458 [ Fact ]
4559 public async Task CanQueueParallelPSCommands ( )
4660 {
You can’t perform that action at this time.
0 commit comments