Skip to content

Call operator not detected for code coverage  #1143

Open
@KreizIT

Description

@KreizIT

1. General summary of the issue

Line where call operator is used is reported as not covered by Pester's codeCoverage capabilty.
ie : $scriptCmd = {& $wrappedCmd @PSBoundParameters }
Code coverage report :
File Function Line Command


ProxyCmd.ps1 Write-TrueHost 29 $scriptCmd = {& $wrappedCmd @PSBoundParameters }
ProxyCmd.ps1 Write-TrueHost 29 & $wrappedCmd @PSBoundParameters

2. Describe Your Environment

Pester version : 4.4.2 C:\Program Files\WindowsPowerShell\Modules\Pester\4.4.2\Pester.psm1
PowerShell version : 5.1.14409.1005
OS version : Microsoft Windows NT 6.1.7601 Service Pack 1

3. Expected Behavior

Report this line as covered

4.Current Behavior

Missing coverage

5. Possible Solution

Tag or mark a line as "excluded" from coverage report ?

6. Context

I'm trying to get a 100% covered code but got only 98% cause of this line :-/

Thanks for help or advise ;)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions