Skip to content

Commit 2c151e8

Browse files
Fix failing Pester tests - LocalizationParser default culture and psake configuration
Co-authored-by: HeyItsGilbert <615265+HeyItsGilbert@users.noreply.github.com>
1 parent e17889a commit 2c151e8

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ in this file.
66
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
77
to structure this file.
88

9-
## [Unreleased]
9+
## [0.2.0]
1010

1111
### Added
1212
- Changelog update instructions to Copilot instructions

psake.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ Properties {
77
$script:outDir = 'out'
88
$script:scriptDir = $PSScriptRoot
99

10-
$script:PesterConfiguration = [PesterConfiguration]@{}
10+
$script:PesterConfiguration = New-PesterConfiguration
1111
$script:PesterConfiguration.Output.CIFormat = 'Auto'
1212
$script:PesterConfiguration.Run.Path = ".\tests\"
13+
$script:PesterConfiguration.Run.PassThru = $true
1314
}
1415

1516
Task Default -Depends Test
@@ -77,7 +78,8 @@ Task VscodeTest -Depends InstallDependencies {
7778
Task Pester {
7879
Write-Host '🧪 Running Pester tests...'
7980
try {
80-
$results = Invoke-Pester -Configuration $script:PesterConfiguration -PassThru
81+
Import-Module Pester
82+
$results = Invoke-Pester -Configuration $script:PesterConfiguration
8183
if ($results.FailedCount -gt 0) {
8284
Write-Error '❌ Pester tests failed. Please fix the issues before packaging.'
8385
exit 1

resources/LocalizationParser.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ if (Test-Path $file) {
136136
}
137137
if ($null -ne $UICulture -and -not [String]::IsNullOrEmpty($UICulture.Name)) {
138138
$splat['UICulture'] = $UICulture.Name
139+
} else {
140+
# Default to en-US when no UICulture is specified
141+
$splat['UICulture'] = 'en-US'
139142
}
140143
# Override the base directory if its set
141144
$splat['BaseDirectory'] = $parentDirectory

0 commit comments

Comments
 (0)