Skip to content

Commit 648cd3e

Browse files
committed
Fix all DebugServiceTests
A number of items needed to be fixed: * `Path.Combine` instead of `Path.Join` because of .NET changes * `ConfigureAwait(false)` because of our rule to always include that * Pass actual script path to `BreakpointDetails.Create` so the debug service has a valid value for its hashtable key * Call `Close()` instead of `Dispose()` (which changed) on `PowerShellContextService` * Make assertion in `AssertDebuggerStopped` case-insensitive * Increase cancellation token source timeouts to 10 seconds * Avoid waiting for PowerShell context state change that never happens and isn't required * Delete unused fields or local variables * Avoid issue with breakpoint ordering (see comment) * Consistently abort the debugger and wait for the `executeTask` * Make `Get-Process` test cross-platform (and execute the right line)
1 parent 301ee69 commit 648cd3e

File tree

2 files changed

+181
-172
lines changed

2 files changed

+181
-172
lines changed

test/PowerShellEditorServices.Test.Shared/Debugging/VariableTest.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ function Test-Variables {
1515
$nullString = [NullString]::Value
1616
$psObjVar = New-Object -TypeName PSObject -Property @{Name = 'John'; Age = 75}
1717
$psCustomObjVar = [PSCustomObject] @{Name = 'Paul'; Age = 73}
18-
$procVar = Get-Process system
18+
$procVar = Get-Process -PID $PID
1919
Write-Output "Done"
2020
}
2121

2222
Test-Variables
23+
# NOTE: If a line is added to the function above, the line numbers in the
24+
# associated unit tests MUST be adjusted accordingly.

0 commit comments

Comments
 (0)