mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Update ConciseView to use TargetObject if applicable (#11075)
This commit is contained in:
1 parent
25895e34b8
commit
6e4da244c5
2 files changed
+42
-8
No files matched your search
@@ -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