Skip to content

Commit

Permalink
lil fix
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 24, 2024
1 parent b6301ec commit b7a87f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .aider/prompts/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Be literal, even with `Describe "$($TestConfig.CommandName)"`
param($ModuleName = 'dbatools')
$global:TestConfig = Get-TestConfig
Describe "$($TestConfig.CommandName)" {
Describe "Get-CommandName" {
Context "Validate parameters" {
BeforeAll {
$command = Get-Command $global:TestConfig.CommandName
Expand Down
5 changes: 3 additions & 2 deletions private/testing/Get-TestConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ function Get-TestConfig {
[string]$LocalConfigPath = "$script:PSModuleRoot/tests/constants.local.ps1"
)
$config = [ordered]@{}
# derive the command name from the CALLING script's filename
$config['CommandName'] = ($MyInvocation.MyCommand.Name | Split-Path -Leaf).Replace(".Tests.ps1", "")

if (Test-Path $LocalConfigPath) {
Write-Host "Tests will use local constants file: tests\constants.local.ps1." -ForegroundColor Cyan
Expand Down Expand Up @@ -60,5 +58,8 @@ function Get-TestConfig {
}
}

# derive the command name from the CALLING script's filename
$config['CommandName'] = ($MyInvocation.MyCommand.Name | Split-Path -Leaf).Replace(".Tests.ps1", "")

[pscustomobject]$config
}

0 comments on commit b7a87f5

Please sign in to comment.