From 02ec64c496a447efe6c3ba905673c088f9246eb7 Mon Sep 17 00:00:00 2001 From: Joel Timothy Oh Date: Wed, 15 May 2024 18:46:13 +0000 Subject: [PATCH] Test (entrypoint): Prioritize using module manifest before script module file for tests --- test/test.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test.ps1 b/test/test.ps1 index fefb425..8033e12 100644 --- a/test/test.ps1 +++ b/test/test.ps1 @@ -11,7 +11,8 @@ $script:PesterDebugPreference_ShowFullErrors = $true try { # Initialize variables - $moduleItem = Get-Item "$PSScriptRoot/../src/*/*.psm1" + $moduleItem = if (Test-Path "$PSScriptRoot/../src/*/*.psd1" -PathType Leaf) { Get-Item "$PSScriptRoot/../src/*/*.psd1" } + elseif (Test-Path "$PSScriptRoot/../src/*/*.psm1" -PathType Leaf) { Get-Item "$PSScriptRoot/../src/*/*.psm1" } $MODULE_PATH = $moduleItem.FullName $MODULE_DIR = $moduleItem.Directory $MODULE_NAME = $moduleItem.BaseName