From 6ed822cd576c32a0a0c09596a8483cddb769fb64 Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Sat, 17 Aug 2024 11:58:12 -0500 Subject: [PATCH] adjusted tests for BeforeDiscovery use --- docs/CHANGELOG.md | 7 +++++++ docs/Catesta.md | 2 +- src/Catesta.build.ps1 | 2 +- src/Catesta/Catesta.psd1 | 2 +- src/Catesta/Resources/Module/src/PSModule.build.ps1 | 2 +- .../src/Tests/v5/Unit/Private/Private-Function.Tests.ps1 | 2 +- .../src/Tests/v5/Unit/Public/Public-Function.Tests.ps1 | 2 +- .../Vault/src/Tests/v5/Unit/ExportedFunctions.Tests.ps1 | 2 +- .../Vault/src/Tests/v5/Unit/Module-Function.Tests.ps1 | 2 +- src/Tests/Integration/New-ModuleProject.Tests.ps1 | 2 +- src/Tests/Integration/New-VaultProject.Tests.ps1 | 2 +- src/Tests/Unit/Public/New-ModuleProject.Tests.ps1 | 2 +- src/Tests/Unit/Public/New-VaultProject.Tests.ps1 | 2 +- 13 files changed, 19 insertions(+), 12 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 3ae30e2..5c3a61b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.21.0] + +- Catesta template module changes + - Unit and infra tests changed from use of import using `BeforeAll` to `BeforeDiscovery` +- Catesta primary module changes + - Unit and infra tests changed from use of import using `BeforeAll` to `BeforeDiscovery` + ## [2.20.0] - Catesta template module changes diff --git a/docs/Catesta.md b/docs/Catesta.md index fa08c6f..673cc6a 100644 --- a/docs/Catesta.md +++ b/docs/Catesta.md @@ -2,7 +2,7 @@ Module Name: Catesta Module Guid: 6796b193-9013-468a-b022-837749af2d06 Download Help Link: NA -Help Version: 2.20.0 +Help Version: 2.21.0 Locale: en-US --- diff --git a/src/Catesta.build.ps1 b/src/Catesta.build.ps1 index 4fe2670..7c9b9c9 100644 --- a/src/Catesta.build.ps1 +++ b/src/Catesta.build.ps1 @@ -271,7 +271,7 @@ Add-BuildTask Test { $pesterConfiguration.CodeCoverage.Path = "/Users/runner/work/$ModuleName/$ModuleName/src/$ModuleName/*/*.ps1" } else { - $pesterConfiguration.CodeCoverage.Path = "..\..\..\src\$ModuleName\*\*.ps1" + $pesterConfiguration.CodeCoverage.Path = "..\..\..\$ModuleName\*\*.ps1" } $pesterConfiguration.TestResult.Enabled = $true $pesterConfiguration.TestResult.OutputPath = "$testOutPutPath\PesterTests.xml" diff --git a/src/Catesta/Catesta.psd1 b/src/Catesta/Catesta.psd1 index e613add..9412361 100644 --- a/src/Catesta/Catesta.psd1 +++ b/src/Catesta/Catesta.psd1 @@ -12,7 +12,7 @@ RootModule = 'Catesta.psm1' # Version number of this module. - ModuleVersion = '2.20.0' + ModuleVersion = '2.21.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/src/Catesta/Resources/Module/src/PSModule.build.ps1 b/src/Catesta/Resources/Module/src/PSModule.build.ps1 index 6a428e1..b19c7c6 100644 --- a/src/Catesta/Resources/Module/src/PSModule.build.ps1 +++ b/src/Catesta/Resources/Module/src/PSModule.build.ps1 @@ -353,7 +353,7 @@ elseif ($PLASTER_PARAM_Pester -eq '5') { $pesterConfiguration.Run.PassThru = $true $pesterConfiguration.Run.Exit = $false $pesterConfiguration.CodeCoverage.Enabled = $true - $pesterConfiguration.CodeCoverage.Path = "..\..\..\src\$ModuleName\*\*.ps1" + $pesterConfiguration.CodeCoverage.Path = "..\..\..\$ModuleName\*\*.ps1" $pesterConfiguration.CodeCoverage.CoveragePercentTarget = $script:coverageThreshold $pesterConfiguration.CodeCoverage.OutputPath = "$codeCovPath\CodeCoverage.xml" $pesterConfiguration.CodeCoverage.OutputFormat = 'JaCoCo' diff --git a/src/Catesta/Resources/Module/src/Tests/v5/Unit/Private/Private-Function.Tests.ps1 b/src/Catesta/Resources/Module/src/Tests/v5/Unit/Private/Private-Function.Tests.ps1 index 73e8a2b..cc06db0 100644 --- a/src/Catesta/Resources/Module/src/Tests/v5/Unit/Private/Private-Function.Tests.ps1 +++ b/src/Catesta/Resources/Module/src/Tests/v5/Unit/Private/Private-Function.Tests.ps1 @@ -1,4 +1,4 @@ -BeforeAll { +BeforeDiscovery { Set-Location -Path $PSScriptRoot $ModuleName = '<%=$PLASTER_PARAM_ModuleName%>' $PathToManifest = [System.IO.Path]::Combine('..', '..', '..', $ModuleName, "$ModuleName.psd1") diff --git a/src/Catesta/Resources/Module/src/Tests/v5/Unit/Public/Public-Function.Tests.ps1 b/src/Catesta/Resources/Module/src/Tests/v5/Unit/Public/Public-Function.Tests.ps1 index e87dbde..2d66bfc 100644 --- a/src/Catesta/Resources/Module/src/Tests/v5/Unit/Public/Public-Function.Tests.ps1 +++ b/src/Catesta/Resources/Module/src/Tests/v5/Unit/Public/Public-Function.Tests.ps1 @@ -1,4 +1,4 @@ -BeforeAll { +BeforeDiscovery { Set-Location -Path $PSScriptRoot $ModuleName = '<%=$PLASTER_PARAM_ModuleName%>' $PathToManifest = [System.IO.Path]::Combine('..', '..', '..', $ModuleName, "$ModuleName.psd1") diff --git a/src/Catesta/Resources/Vault/src/Tests/v5/Unit/ExportedFunctions.Tests.ps1 b/src/Catesta/Resources/Vault/src/Tests/v5/Unit/ExportedFunctions.Tests.ps1 index aa447e3..99711df 100644 --- a/src/Catesta/Resources/Vault/src/Tests/v5/Unit/ExportedFunctions.Tests.ps1 +++ b/src/Catesta/Resources/Vault/src/Tests/v5/Unit/ExportedFunctions.Tests.ps1 @@ -1,4 +1,4 @@ -BeforeAll { +BeforeDiscovery { Set-Location -Path $PSScriptRoot $ModuleName = '<%=$PLASTER_PARAM_ModuleName%>' $PathToManifest = [System.IO.Path]::Combine('..', '..', $ModuleName, "$ModuleName.psd1") diff --git a/src/Catesta/Resources/Vault/src/Tests/v5/Unit/Module-Function.Tests.ps1 b/src/Catesta/Resources/Vault/src/Tests/v5/Unit/Module-Function.Tests.ps1 index 0603f14..51b173b 100644 --- a/src/Catesta/Resources/Vault/src/Tests/v5/Unit/Module-Function.Tests.ps1 +++ b/src/Catesta/Resources/Vault/src/Tests/v5/Unit/Module-Function.Tests.ps1 @@ -1,4 +1,4 @@ -BeforeAll { +BeforeDiscovery { Set-Location -Path $PSScriptRoot $ModuleName = '<%=$PLASTER_PARAM_ModuleName%>' $vaultName = '<%=$PLASTER_PARAM_ModuleName%>' diff --git a/src/Tests/Integration/New-ModuleProject.Tests.ps1 b/src/Tests/Integration/New-ModuleProject.Tests.ps1 index 2b7d6f2..0cbfaa6 100644 --- a/src/Tests/Integration/New-ModuleProject.Tests.ps1 +++ b/src/Tests/Integration/New-ModuleProject.Tests.ps1 @@ -1,4 +1,4 @@ -BeforeAll { +BeforeDiscovery { Set-Location -Path $PSScriptRoot $ModuleName = 'Catesta' $PathToManifest = [System.IO.Path]::Combine('..', '..', 'Artifacts', "$ModuleName.psd1") diff --git a/src/Tests/Integration/New-VaultProject.Tests.ps1 b/src/Tests/Integration/New-VaultProject.Tests.ps1 index b6ba715..b73cfa9 100644 --- a/src/Tests/Integration/New-VaultProject.Tests.ps1 +++ b/src/Tests/Integration/New-VaultProject.Tests.ps1 @@ -1,4 +1,4 @@ -BeforeAll { +BeforeDiscovery { Set-Location -Path $PSScriptRoot $ModuleName = 'Catesta' $PathToManifest = [System.IO.Path]::Combine('..', '..', 'Artifacts', "$ModuleName.psd1") diff --git a/src/Tests/Unit/Public/New-ModuleProject.Tests.ps1 b/src/Tests/Unit/Public/New-ModuleProject.Tests.ps1 index 56beb63..6d81693 100644 --- a/src/Tests/Unit/Public/New-ModuleProject.Tests.ps1 +++ b/src/Tests/Unit/Public/New-ModuleProject.Tests.ps1 @@ -1,4 +1,4 @@ -BeforeAll { +BeforeDiscovery { Set-Location -Path $PSScriptRoot $ModuleName = 'Catesta' $PathToManifest = [System.IO.Path]::Combine('..', '..', '..', $ModuleName, "$ModuleName.psd1") diff --git a/src/Tests/Unit/Public/New-VaultProject.Tests.ps1 b/src/Tests/Unit/Public/New-VaultProject.Tests.ps1 index 7f21060..ad9839b 100644 --- a/src/Tests/Unit/Public/New-VaultProject.Tests.ps1 +++ b/src/Tests/Unit/Public/New-VaultProject.Tests.ps1 @@ -1,4 +1,4 @@ -BeforeAll { +BeforeDiscovery { Set-Location -Path $PSScriptRoot $ModuleName = 'Catesta' $PathToManifest = [System.IO.Path]::Combine('..', '..', '..', $ModuleName, "$ModuleName.psd1")