Skip to content

Commit

Permalink
Pester v5 (#1444)
Browse files Browse the repository at this point in the history
* Replace usage of $MyInvocation.MyCommand.Pat with $PSScriptRoot and cleanup tests

* Fix 2 small mistakes, test should now be green again

* Adapt build.psm1

* Engine tests migration to Pester v5

* use pester v5 in ci and always upload test results

* Upgrade Rule tests to Pester v5 using BeforeAll block and addressing some -Skip problems already

* -AllowPrerelease

* try bootstrap in wmf4

* fix invoke-pester call in CI

* fix CorrectionExtent.tests.ps1

* fix Helper.tests.ps1

* Fix remaining tests with BeforeAll/AfterAll (discovery works now)

* fix UseUsingScopeModifierInNewRunspaces.tests.ps1

* make test cases more readable

* cleanup UseUsingScopeModifierInNewRunspaces.tests.ps1

* Fix UseShouldProcessForStateChangingFunctions.tests.ps1

* cleanup UseShouldProcessForStateChangingFunctions.tests.ps1

* Fix PSCompatibilityCollector/Tests/UtilityApi.Tests.ps1

* Fix InvokeScriptAnalyzer.tests.ps1

* Format InvokeScriptAnalyzer.tests.ps1

* Fix ModuleHelp.Tests.ps1 and cleanup

* Fix RuleSuppression.tests.ps1

* Fix Settings.tests.ps1

* format Settings.tests.ps1

* Fix Tests/Engine/TextEdit.tests.ps1 and format

* Fix AllCompatibilityRules.Tests.ps1

* Fix AvoidUnloadableModuleOrMissingRequiredFieldInManifest.tests.ps1

* Format AvoidUnloadableModuleOrMissingRequiredFieldInManifest.tests.ps1 to fix indentation

* Fix AvoidUsingPlainTextForPassword.tests.ps1

* fix place*brace tests

* Format brace tests and fix PSCredentialType.tests.ps1

* Fix UseCompatibleCommands.Tests.ps1

* Fix UseCompatibleSyntax.Tests.ps1

* Fix UseCompatibleTypes.Tests.ps1

* Fix UseCompatibleCmdlets.tests.ps1

* Fix variable clash between compatibility tests that were not in BeforeEach block and remove unused variables

* Fix LibraryUsage.tests.ps1 teardown syntax

* Fix LibraryUsage.tests.ps1

* rc3 for wmf4

* Properly execute library tests and cleanup CustomizedRule.tests.ps1

* tidy up

* cleanup module imports and only import once at the root

* Fix 5 of 6 v4 tests and add logging to better understand modulehelp failure

* remove test-psversion functions and fix v3 or v4 checks

* Fix ModuleHelp.Tests.ps1 for v4 and cleanup

* Really fix ModuleHelp.Tests.ps1 on v4 and cleanup invoke-pester calls

* add debugging as to why there is no TestResults.xml on Ubuntu

* fix yaml

* fix test file upload on Ubuntu (casing) and ensure test file always gets uploaded on appveyor

* move appveyor upload back

* move appveyor into finally

* fix merge error to make install pester v5 again

* Pester rc4

* Update to rc5

* cleanup ci run

* rc6

* rc7

* rc8

* Update appveyor.psm1

* don't use -CI switch for local build and disable code coverage in CI

* import pester module before running tests to import types

* fix property name

* actually use configuration object (doh)

* config object

* fix output verbosity

* fix type casting of [string[]] of pester paths

* pester 5 GA

* Pester 5.0.2

* move testcases declaration before test

* remove left-over comments

* remove unnecessary [bool] in if condition

* simplify version check to not require [version] type and patch version

* fix missing whitespace in test that made test invalid

* empty commit since Azure Pipelines did not trigger

* empty commit since Azure Pipelines did not trigger again

* empty commit since Azure Pipelines did not trigger again

Co-authored-by: Christoph Bergmeister <[email protected]>
  • Loading branch information
bergmeister and Christoph Bergmeister authored Jun 11, 2020
1 parent 67805a1 commit 7354892
Show file tree
Hide file tree
Showing 87 changed files with 2,403 additions and 2,134 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines-ci/templates/test-powershell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ steps:
- task: PublishTestResults@2
inputs:
testRunner: NUnit
testResultsFiles: 'TestResults.xml'
testResultsFiles: 'testResults.xml'
condition: succeededOrFailed()
237 changes: 108 additions & 129 deletions PSCompatibilityCollector/Tests/UtilityApi.Tests.ps1

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Note: the PSScriptAnalyzer Chocolatey package is provided and supported by the c
#### Requirements

* [.NET Core 3.1.102 SDK](https://www.microsoft.com/net/download/dotnet-core/3.1#sdk-3.1.102) or newer patch release
* [Pester v4 PowerShell module, available on PowerShell Gallery](https://github.com/pester/Pester)
* [Pester v5 PowerShell module, available on PowerShell Gallery](https://github.com/pester/Pester)
* [PlatyPS PowerShell module, available on PowerShell Gallery](https://github.com/PowerShell/platyPS/releases)
* Optionally but recommended for development: [Visual Studio 2017/2019](https://www.visualstudio.com/downloads/)

Expand Down
3 changes: 1 addition & 2 deletions Tests/DisabledRules/UseTypeAtVariableAssignment.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Import-Module -Verbose PSScriptAnalyzer
$violationMessage = [regex]::Escape('Specify type at the assignment of variable $test')
$violationMessage = [regex]::Escape('Specify type at the assignment of variable $test')
$violationName = "PSUseTypeAtVariableAssignment"
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
$violations = Invoke-ScriptAnalyzer $directory\UseTypeAtVariableAssignment.ps1 | Where-Object {$_.RuleName -eq $violationName}
Expand Down
6 changes: 4 additions & 2 deletions Tests/Engine/CorrectionExtent.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
Describe "Correction Extent" {
$type = [Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.CorrectionExtent]
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

Describe "Correction Extent" {
Context "Object construction" {
It "creates the object with correct properties" {
$type = [Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.CorrectionExtent]
$correctionExtent = $obj = New-Object -TypeName $type -ArgumentList 1, 1, 1, 3, "get-childitem", "newfile", "cool description"

$correctionExtent.StartLineNumber | Should -Be 1
Expand Down
93 changes: 47 additions & 46 deletions Tests/Engine/CustomizedRule.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
if (-not $IsCoreCLR)
{
# Force Get-Help not to prompt for interactive input to download help using Update-Help
# By adding this registry key we turn off Get-Help interactivity logic during ScriptRule parsing
$null,"Wow6432Node" | ForEach-Object {
try
{
Set-ItemProperty -Name "DisablePromptToUpdateHelp" -Path "HKLM:\SOFTWARE\$($_)\Microsoft\PowerShell" -Value 1 -Force -ErrorAction SilentlyContinue
}
catch
{
# Ignore for cases when tests are running in non-elevated more or registry key does not exist or not accessible
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

BeforeAll {
if (-not $IsCoreCLR)
{
# Force Get-Help not to prompt for interactive input to download help using Update-Help
# By adding this registry key we turn off Get-Help interactivity logic during ScriptRule parsing
$null,"Wow6432Node" | ForEach-Object {
try
{
Set-ItemProperty -Name "DisablePromptToUpdateHelp" -Path "HKLM:\SOFTWARE\$($_)\Microsoft\PowerShell" -Value 1 -Force -ErrorAction SilentlyContinue
}
catch
{
# Ignore for cases when tests are running in non-elevated more or registry key does not exist or not accessible
}
}
}
$message = "this is help"
$measure = "Measure-RequiresRunAsAdministrator"
}


$message = "this is help"
$measure = "Measure-RequiresRunAsAdministrator"

Describe "Test importing customized rules with null return results" {
Context "Test Get-ScriptAnalyzer with customized rules" {
It "will not terminate the engine" {
Expand All @@ -38,40 +42,38 @@ Describe "Test importing customized rules with null return results" {

Describe "Test importing correct customized rules" {

if(-not $IsCoreCLR)
{
Context "Test Get-Help functionality in ScriptRule parsing logic" {
It "ScriptRule help section must be correctly processed when Get-Help is called for the first time" {

# Force Get-Help to prompt for interactive input to download help using Update-Help
# By removing this registry key we force to turn on Get-Help interactivity logic during ScriptRule parsing
$null,"Wow6432Node" | ForEach-Object {
try
{
Remove-ItemProperty -Name "DisablePromptToUpdateHelp" -Path "HKLM:\SOFTWARE\$($_)\Microsoft\PowerShell" -ErrorAction Stop
} catch {
#Ignore for cases when tests are running in non-elevated more or registry key does not exist or not accessible
}
Context "Test Get-Help functionality in ScriptRule parsing logic" -Skip:$IsCoreCLR {
It "ScriptRule help section must be correctly processed when Get-Help is called for the first time" {

# Force Get-Help to prompt for interactive input to download help using Update-Help
# By removing this registry key we force to turn on Get-Help interactivity logic during ScriptRule parsing
$null,"Wow6432Node" | ForEach-Object {
try
{
Remove-ItemProperty -Name "DisablePromptToUpdateHelp" -Path "HKLM:\SOFTWARE\$($_)\Microsoft\PowerShell" -ErrorAction Stop
} catch {
#Ignore for cases when tests are running in non-elevated more or registry key does not exist or not accessible
}
}

$customizedRulePath = Invoke-ScriptAnalyzer $PSScriptRoot\TestScript.ps1 -CustomizedRulePath $PSScriptRoot\samplerule\samplerule.psm1 | Where-Object {$_.Message -eq $message}
$customizedRulePath.Count | Should -Be 1
$customizedRulePath = Invoke-ScriptAnalyzer $PSScriptRoot\TestScript.ps1 -CustomizedRulePath $PSScriptRoot\samplerule\samplerule.psm1 | Where-Object {$_.Message -eq $message}
$customizedRulePath.Count | Should -Be 1

# Force Get-Help not to prompt for interactive input to download help using Update-Help
# By adding this registry key we turn off Get-Help interactivity logic during ScriptRule parsing
$null,"Wow6432Node" | ForEach-Object {
try
{
Set-ItemProperty -Name "DisablePromptToUpdateHelp" -Path "HKLM:\SOFTWARE\$($_)\Microsoft\PowerShell" -Value 1 -Force -EA SilentlyContinue
}
catch
{
# Ignore for cases when tests are running in non-elevated more or registry key does not exist or not accessible
}
# Force Get-Help not to prompt for interactive input to download help using Update-Help
# By adding this registry key we turn off Get-Help interactivity logic during ScriptRule parsing
$null,"Wow6432Node" | ForEach-Object {
try
{
Set-ItemProperty -Name "DisablePromptToUpdateHelp" -Path "HKLM:\SOFTWARE\$($_)\Microsoft\PowerShell" -Value 1 -Force -EA SilentlyContinue
}
catch
{
# Ignore for cases when tests are running in non-elevated more or registry key does not exist or not accessible
}
}
}
}
# }

Context "Test Get-ScriptAnalyzer with customized rules" {
It "will show the custom rule" {
Expand Down Expand Up @@ -197,8 +199,7 @@ Describe "Test importing correct customized rules" {
$violations[0].RuleSuppressionID | Should -Be "MyRuleSuppressionID"
}

if (!$testingLibraryUsage)
{
Context "Test Invoke-ScriptAnalyzer with customized rules - Advanced test cases" -Skip:$testingLibraryUsage {
It "will show the custom rule in the results when given a rule folder path with trailing backslash" {
# needs fixing for Linux
if (!$IsLinux -and !$IsMacOS)
Expand Down Expand Up @@ -243,15 +244,15 @@ Describe "Test importing correct customized rules" {
$customizedRulePath.Count | Should -Be 1
}

It "loads custom rules that contain version in their path" -Skip:($PSVersionTable.PSVersion -lt [Version]'5.0.0') {
It "loads custom rules that contain version in their path" -Skip:($PSVersionTable.PSVersion -lt '5.0') {
$customizedRulePath = Invoke-ScriptAnalyzer $PSScriptRoot\TestScript.ps1 -CustomRulePath $PSScriptRoot\VersionedSampleRule\SampleRuleWithVersion
$customizedRulePath.Count | Should -Be 1

$customizedRulePath = Get-ScriptAnalyzerRule -CustomRulePath $PSScriptRoot\VersionedSampleRule\SampleRuleWithVersion
$customizedRulePath.Count | Should -Be 1
}

It "loads custom rules that contain version in their path with the RecurseCustomRule switch" -Skip:($PSVersionTable.PSVersion -lt [Version]'5.0.0') {
It "loads custom rules that contain version in their path with the RecurseCustomRule switch" -Skip:($PSVersionTable.PSVersion -lt '5.0') {
$customizedRulePath = Invoke-ScriptAnalyzer $PSScriptRoot\TestScript.ps1 -CustomRulePath $PSScriptRoot\VersionedSampleRule -RecurseCustomRulePath
$customizedRulePath.Count | Should -Be 1

Expand Down
13 changes: 9 additions & 4 deletions Tests/Engine/EditableText.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
$testRootDirectory = Split-Path -Parent $PSScriptRoot
Import-Module (Join-Path $testRootDirectory "PSScriptAnalyzerTestHelper.psm1")
$editableTextType = "Microsoft.Windows.PowerShell.ScriptAnalyzer.EditableText"
$textEditType = "Microsoft.Windows.PowerShell.ScriptAnalyzer.TextEdit"
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

BeforeAll {
$testRootDirectory = Split-Path -Parent $PSScriptRoot
Import-Module (Join-Path $testRootDirectory "PSScriptAnalyzerTestHelper.psm1")
$editableTextType = "Microsoft.Windows.PowerShell.ScriptAnalyzer.EditableText"
$textEditType = "Microsoft.Windows.PowerShell.ScriptAnalyzer.TextEdit"
}

Describe "EditableText class" {
Context "When a single edit is given for application" {
Expand Down
54 changes: 30 additions & 24 deletions Tests/Engine/Extensions.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
$testRootDirectory = Split-Path -Parent $PSScriptRoot
Import-Module (Join-Path $testRootDirectory "PSScriptAnalyzerTestHelper.psm1")

function Get-Extent {
param($line, $startLineNum, $startColumnNum, $endLineNum, $endColumnNum)
$scriptPositionType = 'System.Management.Automation.Language.ScriptPosition'
$scriptExtentType = 'System.Management.Automation.Language.ScriptExtent'
$extentStartPos = New-Object -TypeName $scriptPositionType -ArgumentList $null, $startLineNum, $startColumnNum, $line
$extentEndPos = New-Object -TypeName $scriptPositionType -ArgumentList $null, $endLineNum, $endColumnNum, $line
New-Object -TypeName $scriptExtentType -ArgumentList $extentStartPos, $extentEndPos
}
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

BeforeAll {
$testRootDirectory = Split-Path -Parent $PSScriptRoot
Import-Module (Join-Path $testRootDirectory "PSScriptAnalyzerTestHelper.psm1")

function Get-Extent {
param($line, $startLineNum, $startColumnNum, $endLineNum, $endColumnNum)
$scriptPositionType = 'System.Management.Automation.Language.ScriptPosition'
$scriptExtentType = 'System.Management.Automation.Language.ScriptExtent'
$extentStartPos = New-Object -TypeName $scriptPositionType -ArgumentList $null, $startLineNum, $startColumnNum, $line
$extentEndPos = New-Object -TypeName $scriptPositionType -ArgumentList $null, $endLineNum, $endColumnNum, $line
New-Object -TypeName $scriptExtentType -ArgumentList $extentStartPos, $extentEndPos
}

function Test-Extent {
param(
$translatedExtent,
$expectedStartLineNumber,
$expectedStartColumnNumber,
$expectedEndLineNumber,
$expectedEndColumnNumber)

$translatedExtent.StartLineNumber | Should -Be $expectedStartLineNumber
$translatedExtent.StartColumnNumber | Should -Be $expectedStartColumnNumber
$translatedExtent.EndLineNumber | Should -Be $expectedEndLineNumber
$translatedExtent.EndColumnNumber | Should -Be $expectedEndColumnNumber
}

function Test-Extent {
param(
$translatedExtent,
$expectedStartLineNumber,
$expectedStartColumnNumber,
$expectedEndLineNumber,
$expectedEndColumnNumber)

$translatedExtent.StartLineNumber | Should -Be $expectedStartLineNumber
$translatedExtent.StartColumnNumber | Should -Be $expectedStartColumnNumber
$translatedExtent.EndLineNumber | Should -Be $expectedEndLineNumber
$translatedExtent.EndColumnNumber | Should -Be $expectedEndColumnNumber
$extNamespace = [Microsoft.Windows.PowerShell.ScriptAnalyzer.Extensions.Extensions]
}

$extNamespace = [Microsoft.Windows.PowerShell.ScriptAnalyzer.Extensions.Extensions]

Describe "String extension methods" {
Context "When a text is given to GetLines" {
Expand Down
42 changes: 24 additions & 18 deletions Tests/Engine/GetScriptAnalyzerRule.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
$testRootDirectory = Split-Path -Parent $PSScriptRoot
Import-Module (Join-Path $testRootDirectory 'PSScriptAnalyzerTestHelper.psm1')
$sa = Get-Command Get-ScriptAnalyzerRule
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

$singularNouns = "PSUseSingularNouns" # this rule does not exist for coreclr version
$approvedVerbs = "PSUseApprovedVerbs"
$cmdletAliases = "PSAvoidUsingCmdletAliases"
$dscIdentical = "PSDSCUseIdenticalParametersForDSC"
BeforeAll {
$sa = Get-Command Get-ScriptAnalyzerRule

$singularNouns = "PSUseSingularNouns" # this rule does not exist for coreclr version
$approvedVerbs = "PSUseApprovedVerbs"
$cmdletAliases = "PSAvoidUsingCmdletAliases"
$dscIdentical = "PSDSCUseIdenticalParametersForDSC"
}

Describe "Test available parameters" {
$params = $sa.Parameters
BeforeAll {
$params = $sa.Parameters
}

Context "Name parameter" {
It "has a RuleName parameter" {
$params.ContainsKey("Name") | Should -BeTrue
Expand All @@ -32,7 +38,6 @@ Describe "Test available parameters" {
$params.CustomRulePath.Aliases.Contains("CustomizedRulePath") | Should -BeTrue
}
}

}

Describe "Test Name parameters" {
Expand All @@ -59,7 +64,7 @@ Describe "Test Name parameters" {
It "get Rules with no parameters supplied" {
$defaultRules = Get-ScriptAnalyzerRule
$expectedNumRules = 64
if ((Test-PSEditionCoreClr) -or (Test-PSVersionV3) -or (Test-PSVersionV4))
if ($IsCoreCLR -or ($PSVersionTable.PSVersion.Major -eq 3) -or ($PSVersionTable.PSVersion.Major -eq 4))
{
# for PSv3 PSAvoidGlobalAliases is not shipped because
# it uses StaticParameterBinder.BindCommand which is
Expand Down Expand Up @@ -94,15 +99,16 @@ Describe "Test Name parameters" {
}

Describe "Test RuleExtension" {
$community = "CommunityAnalyzerRules"
$measureRequired = "Measure-RequiresModules"
Context "When used correctly" {

$expectedNumCommunityRules = 10
if ($PSVersionTable.PSVersion -ge [Version]'4.0.0')
{
$expectedNumCommunityRules = 12
}
BeforeAll {
$community = "CommunityAnalyzerRules"
$measureRequired = "Measure-RequiresModules"
$expectedNumCommunityRules = 10
if ($PSVersionTable.PSVersion -ge [Version]'4.0.0')
{
$expectedNumCommunityRules = 12
}
}
It "with the module folder path" {
$ruleExtension = Get-ScriptAnalyzerRule -CustomizedRulePath $PSScriptRoot\CommunityAnalyzerRules | Where-Object {$_.SourceName -eq $community}
$ruleExtension.Count | Should -Be $expectedNumCommunityRules
Expand Down
19 changes: 8 additions & 11 deletions Tests/Engine/GlobalSuppression.test.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Check if PSScriptAnalyzer is already loaded so we don't
# overwrite a test version of Invoke-ScriptAnalyzer by
# accident
if (!(Get-Module PSScriptAnalyzer) -and !$testingLibraryUsage)
{
Import-Module -Verbose PSScriptAnalyzer
}
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

$violations = Invoke-ScriptAnalyzer "$PSScriptRoot\GlobalSuppression.ps1"
$violationsUsingScriptDefinition = Invoke-ScriptAnalyzer -ScriptDefinition (Get-Content -Raw "$PSScriptRoot\GlobalSuppression.ps1")
$suppression = Invoke-ScriptAnalyzer "$PSScriptRoot\GlobalSuppression.ps1" -Profile "$PSScriptRoot\Profile.ps1"
$suppressionUsingScriptDefinition = Invoke-ScriptAnalyzer -ScriptDefinition (Get-Content -Raw "$PSScriptRoot\GlobalSuppression.ps1") -Profile "$PSScriptRoot\Profile.ps1"
BeforeAll {
$violations = Invoke-ScriptAnalyzer "$PSScriptRoot\GlobalSuppression.ps1"
$violationsUsingScriptDefinition = Invoke-ScriptAnalyzer -ScriptDefinition (Get-Content -Raw "$PSScriptRoot\GlobalSuppression.ps1")
$suppression = Invoke-ScriptAnalyzer "$PSScriptRoot\GlobalSuppression.ps1" -Profile "$PSScriptRoot\Profile.ps1"
$suppressionUsingScriptDefinition = Invoke-ScriptAnalyzer -ScriptDefinition (Get-Content -Raw "$PSScriptRoot\GlobalSuppression.ps1") -Profile "$PSScriptRoot\Profile.ps1"
}

Describe "GlobalSuppression" {
Context "Exclude Rule" {
Expand Down
23 changes: 14 additions & 9 deletions Tests/Engine/Helper.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

Describe "Test Directed Graph" {
Context "When a graph is created" {
$digraph = New-Object -TypeName 'Microsoft.Windows.PowerShell.ScriptAnalyzer.DiGraph[string]'
$digraph.AddVertex('v1');
$digraph.AddVertex('v2');
$digraph.AddVertex('v3');
$digraph.AddVertex('v4');
$digraph.AddVertex('v5');
BeforeAll {
$digraph = New-Object -TypeName 'Microsoft.Windows.PowerShell.ScriptAnalyzer.DiGraph[string]'
$digraph.AddVertex('v1');
$digraph.AddVertex('v2');
$digraph.AddVertex('v3');
$digraph.AddVertex('v4');
$digraph.AddVertex('v5');

$digraph.AddEdge('v1', 'v2');
$digraph.AddEdge('v1', 'v5');
$digraph.AddEdge('v2', 'v4');
$digraph.AddEdge('v1', 'v2');
$digraph.AddEdge('v1', 'v5');
$digraph.AddEdge('v2', 'v4');
}

It "correctly adds the vertices" {
$digraph.NumVertices | Should -Be 5
Expand Down
9 changes: 7 additions & 2 deletions Tests/Engine/InvokeFormatter.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
$testRootDirectory = Split-Path -Parent $PSScriptRoot
Import-Module (Join-Path $testRootDirectory "PSScriptAnalyzerTestHelper.psm1")
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

BeforeAll {
$testRootDirectory = Split-Path -Parent $PSScriptRoot
Import-Module (Join-Path $testRootDirectory "PSScriptAnalyzerTestHelper.psm1")
}

Describe "Invoke-Formatter Cmdlet" {
Context "Cmdlet cleans up and has no knock on effect" {
Expand Down
Loading

0 comments on commit 7354892

Please sign in to comment.