Stop HttpListener from running in WebCmdlet tests (#5921)
This commit is contained in:
parent
bb8d5562c5
commit
febc1e8bd0
|
@ -373,15 +373,9 @@ if ( test-path /etc/centos-release ) { $PendingCertificateTest = $true }
|
|||
|
||||
Describe "Invoke-WebRequest tests" -Tags "Feature" {
|
||||
BeforeAll {
|
||||
$response = Start-HttpListener -Port 8080
|
||||
$WebListener = Start-WebListener
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
$null = Stop-HttpListener -Port 8080
|
||||
$response.PowerShell.Dispose()
|
||||
}
|
||||
|
||||
# Validate the output of Invoke-WebRequest
|
||||
#
|
||||
function ValidateResponse {
|
||||
|
@ -1419,15 +1413,9 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" {
|
|||
|
||||
Describe "Invoke-RestMethod tests" -Tags "Feature" {
|
||||
BeforeAll {
|
||||
$response = Start-HttpListener -Port 8081
|
||||
$WebListener = Start-WebListener
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
$null = Stop-HttpListener -Port 8081
|
||||
$response.PowerShell.Dispose()
|
||||
}
|
||||
|
||||
#User-Agent changes on different platforms, so tests should only be run if on the correct platform
|
||||
It "Invoke-RestMethod returns Correct User-Agent on MacOSX" -Skip:(!$IsMacOS) {
|
||||
$uri = Get-WebListenerUrl -Test 'Get'
|
||||
|
|
Loading…
Reference in a new issue