mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Update ConciseView to use TargetObject if applicable (#11075)
This commit is contained in:
committed by
Aditya Patwardhan
parent
25895e34b8
commit
6e4da244c5
@@ -57,5 +57,14 @@ Describe 'Tests for $ErrorView' -Tag CI {
|
||||
$e = pwsh -noprofile -command 'function test-myerror { [cmdletbinding()] param() write-error "myError" }; test-myerror -ErrorAction SilentlyContinue; $error[0] | Out-String'
|
||||
[string]::Join('', $e).Trim() | Should -BeLike "*test-myerror:*myError*" # wildcard due to VT100
|
||||
}
|
||||
|
||||
It "Pester Should shows test file and not pester" {
|
||||
$testScript = '1 + 1 | Should -Be 3'
|
||||
$testScriptPath = Join-Path -Path $TestDrive -ChildPath 'mytest.ps1'
|
||||
Set-Content -Path $testScriptPath -Value $testScript
|
||||
$e = { & $testScriptPath } | Should -Throw -ErrorId 'PesterAssertionFailed' -PassThru
|
||||
$e | Out-String | Should -BeLike "*$testScriptPath*"
|
||||
$e | Out-String | Should -Not -BeLike '*pester*'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user