Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Add support for passing a PesterConfiguration object to PowerShellBuild

Aberta
#83 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Precisa de esclarecimento
Status de atividade
Ativa
Stack de tecnologia
powershell
Domínio
testing

Direção de pesquisa

Comece rastreando como PowerShellBuild invoca o Pester e como as opções existentes de $PSBPreference.Test são aplicadas. Revise o valor proposto de $PSBPreference.Test.Configuration e os exemplos de PesterConfiguration e, em seguida, resolva a precedência para caminhos e outras configurações. A tarefa estará concluída quando os usuários puderem fornecer uma configuração e o comportamento de teste padrão pretendido continuar claro e coberto.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

enhancement

Currently PowerShellBuild accepts several options to control how Pester is invoked through the $PSBPreference variable. However, there are more Pester options available if you go the "advanced" route and pass in a [PesterConfiguration] object.

You can generate a configuration a few different ways...

$config = New-PesterConfiguration

$config = [PesterConfiguration]::Default

$config = [PesterConfiguration]::new()

We could support all Pester options in an easier way than implementing $PSBPreference settings for each of them individually by allowing users to provide their own Pester configuration like so...

# file: psakeFile.ps1
Properties {
    $PSBPreference.Test.Configuration = New-PesterConfiguration -Hashtable @{
        # Change defaults as needed. For example...
        Run = @{
            SkipRemainingOnFailure = 'Run'
        }
    }
}

There are some considerations though. For example, the advanced option allows providing multiple paths. Should PowerShellBuild be opinionated and aim to maintain the current test behavior by default? If PowerShellBuild overrides properties like Run.Path, should the user be allowed to change that? How so?

Maybe other values from $PSBPreference.Test should be used to override the user-supplied [PesterConfiguration] and if they want to override those defaults, they should do it by updating the corresponding $PSBPreference.Test.* property?

Linguagem predominante
PowerShell
Estrelas
145
Forks
27
Merge médio
2h 32min
PRs com merge (30d)
20

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de psake/PowerShellBuild

Todas as issues de psake/PowerShellBuild

Issues semelhantes

Mais issues de Testing & QA

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.