Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Commit 629d8a8

Browse files
⚙️ [Maintenance]: Require Pester 6.x in test files (#26)
Pester tests in this module now require the Pester **6.x** major version, so every contributor and CI run resolves the same major and a new Pester major can't slip in and break the suite. The tests previously declared no framework requirement and ran on whatever Pester happened to be installed. ## Changed: tests are locked to the Pester 6.x major Every `*.Tests.ps1` file now starts with a version-bounded requirement: ```powershell #Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.0.0'; MaximumVersion = '6.*' } ``` Any Pester `6.x` satisfies it, so minor and patch releases flow in automatically while moving to a new major stays a deliberate, reviewed change. No module source or behaviour changes. ## Technical Details - Prepends a `#Requires -Modules` statement to each test file under `tests/`; non-test files are untouched. - `ModuleVersion = '6.0.0'` is the floor and `MaximumVersion = '6.*'` the wildcard major ceiling. Module-identity (`GUID`) pinning is intentionally omitted — it is a separate supply-chain control, not part of the lock-to-major risk appetite. - The install side is locked to the same major in PSModule/Invoke-Pester#70. Part of the dependency-management epic PSModule/Process-PSModule#356.
1 parent e14eca6 commit 629d8a8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

tests/Environment.Tests.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
BeforeAll {
1+
#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.0.0'; MaximumVersion = '6.*' }
2+
3+
BeforeAll {
24
# Minimal test file for validation purposes
35
}
46

tests/PSModuleTest.Tests.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
BeforeAll {
1+
#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.0.0'; MaximumVersion = '6.*' }
2+
3+
BeforeAll {
24
# Minimal test file for validation purposes
35
}
46

0 commit comments

Comments
 (0)