feat: refactor file paths to use %LOCALAPPDATA% for user data and logs (#829)

This commit is contained in:
Jeffrey
2026-10-17 00:17:44 +02:00
committed by GitHub
parent 25c3999be5
commit dd1f934174
6 changed files with 21 additions and 15 deletions
+8
View File
@@ -18,6 +18,14 @@ BeforeAll {
}
Describe 'Save-ToFile' {
It 'creates the destination directory on first use' {
$path = Join-Path $TestDrive 'UserData\LastUsedSettings.json'
Save-ToFile -Config @{ Setting = $true } -FilePath $path | Should -BeTrue
(Get-Content -LiteralPath $path -Raw | ConvertFrom-Json).Setting | Should -BeTrue
}
It 'reports the write error and returns false when persistence fails' {
Mock Set-Content { throw [System.IO.IOException]::new('Disk is full') }
Mock Write-Error {}