Skip to content

Commit 1aeb448

Browse files
authored
Fix so that $CustomModulePath is used (#190)
Module wasn't actually being imported, thanks @johlju!
1 parent 4cf250c commit 1aeb448

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Scripts/PesterInterface.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ param(
2626
)
2727

2828
try {
29-
Import-Module -Name Pester -MinimumVersion '5.2.0' -ErrorAction Stop
29+
$modulePath = if ($CustomModulePath) { Resolve-Path $CustomModulePath -ErrorAction Stop } else { 'Pester' }
30+
Import-Module -Name $modulePath -MinimumVersion '5.2.0' -ErrorAction Stop
3031
} catch {
3132
if ($PSItem.FullyQualifiedErrorId -ne 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand') { throw }
3233

@@ -121,8 +122,6 @@ function Unregister-PesterPlugin ([hashtable]$PluginConfiguration) {
121122

122123
#Main Function
123124
function Invoke-Main {
124-
$modulePath = if ($CustomModulePath) { Resolve-Path $CustomModulePath -ErrorAction Stop } else { 'Pester' }
125-
Import-Module -MinimumVersion '5.2.0' -Name $modulePath -ErrorAction Stop
126125
$pluginModule = Import-PrivateModule $PSScriptRoot/PesterTestPlugin.psm1
127126

128127
$configArgs = @{

0 commit comments

Comments
 (0)