gaelcolas / gaelcolas/Sampler

Simplify running code coverage for a single test file

Open
#387 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
PowerShell
Stars
243
Forks
46
Avg merge
1h 41m
Merged PRs (30d)
1

Description

### Problem description

Currently when running `./build.ps1 -Task test -PesterPath ‘testfile’` it runs code coverage on all files in the built module result in a lot out missed lines (especially for big modules).

To be able to run code coverage for a single file using `Invoke-Pester` you have to pass a `New-PesterConfiguration` filled with the code script path and coverage path and settings. This can be complicated for new contributors.

### Verbose logs

```text
m/a
```

### How to reproduce

n/a

### Expected behavior

n/a

### Current behavior

n/a

### Suggested solution

We should simplify that by adding a `CodeCovergePath` to `build.ps1` so it possible to write:

```powershell
.\build.ps1 -Task test -PesterPath ‘testfile’ -CodeCoveragePath ‘code_script_file’
```
It will then also use settings from the build configuration.

### Operating system the target node is running

```text
n/a
```

### PowerShell version and build the target node is running

```text
n/a
```

### Module version used

```text
n/a
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.