Commit 36ecce3
Fix failing psakeFile Pester task - LocalizationParser default culture and psake configuration (#11)
The CI pipeline was failing with Pester test errors due to two main
issues in the PowerShell localization testing infrastructure.
## Issues Fixed
### 1. LocalizationParser Missing Default Culture
The `LocalizationParser.ps1` script was failing when no `UICulture`
parameter was provided. The script uses `Import-LocalizedData` which
requires a specific culture to locate files in culture-specific
subdirectories (e.g., `en-US/Example.psd1`, `fr-FR/Example.psd1`). When
running in environments with invariant culture, the localization files
couldn't be found.
**Before:**
```powershell
# Failed - no localization files found
pwsh -File ./resources/LocalizationParser.ps1 -ModuleFile ./tests/fixtures/Example/Example.psm1
```
**After:**
```powershell
# Works - defaults to en-US culture
pwsh -File ./resources/LocalizationParser.ps1 -ModuleFile ./tests/fixtures/Example/Example.psm1
```
### 2. Outdated Pester Configuration Syntax
The `psake.ps1` build script was using deprecated Pester configuration
syntax that's incompatible with Pester 5.x. The script was attempting to
create a `[PesterConfiguration]` object directly and use `-PassThru` as
a parameter.
**Before:**
```powershell
$script:PesterConfiguration = [PesterConfiguration]@{}
$results = Invoke-Pester -Configuration $script:PesterConfiguration -PassThru
```
**After:**
```powershell
$script:PesterConfiguration = New-PesterConfiguration
$script:PesterConfiguration.Run.PassThru = $true
$results = Invoke-Pester -Configuration $script:PesterConfiguration
```
## Validation Results
All tests now pass successfully:
- ✅ LocalizationParser tests (8/8 tests pass)
- ✅ MetaTests validation (3/3 tests pass)
- ✅ English localization returns: "Value1", "Value2", "Value3"
- ✅ French localization returns: "Valeur1", "Valeur2", "Valeur3"
- ✅ TypeScript compilation and linting pass
The CI pipeline Pester task will now execute successfully without the
previous `Import-LocalizedData` errors.
Fixes #10.
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: HeyItsGilbert <615265+HeyItsGilbert@users.noreply.github.com>1 parent 94e7a95 commit 36ecce3
3 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
31 | 39 | | |
32 | 40 | | |
33 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
0 commit comments