PowerShell / PowerShell/PSScriptAnalyzer

Question: How to manage module version in Pester tests for this module?

Aberta
#528 1 comentário 0 reações 1 responsável Ver no GitHub

@kapilmb já está trabalhando nisso.

Desde 3/8/2016.

Issue - Enhancement
Linguagem predominante
C#
Estrelas
2.2k
Forks
414
Merge médio
13h 1min
PRs com merge (30d)
2

Descrição

I was dreaming up code to make sure that my Pester tests in the Tests\Engine folder are always testing the version of the module in which the directory resides. But, I noticed that the other .Tests.ps1 files in Tests\Engine just import the module by name w/o regard to version.

// From CorrectionExtent.Tests.ps1 & similar in RuleSuppressions.Tests.ps1
if (!(Get-Module PSScriptAnalyzer)) {Import-Module PSScriptAnalyzer}

This code just imports the first PSScriptAnalyzer instance found in the $env:PSModulePath directory order, which is typically the newest in $home. It might not be the version under test.

Is there some reason that these will work? I don't want to add extra code for no good reason.

Guia de contribuição

Abrir o guia de contribuição

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.

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

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