mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-10-20 04:32:02 +00:00
feat: refactor file paths to use %LOCALAPPDATA% for user data and logs (#829)
This commit is contained in:
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user