From 386ae0c5814ccdf8cdbfa04ba1b746d3cf058155 Mon Sep 17 00:00:00 2001 From: HetCreep <239326951+HetCreep@users.noreply.github.com> Date: Thu, 8 Oct 2026 04:51:23 +0700 Subject: [PATCH] test: stop the start-menu restore specs sharing a restore copy (#801) --- Tests/Replace-StartMenu.Tests.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/Replace-StartMenu.Tests.ps1 b/Tests/Replace-StartMenu.Tests.ps1 index 41f13b6..593e1d8 100644 --- a/Tests/Replace-StartMenu.Tests.ps1 +++ b/Tests/Replace-StartMenu.Tests.ps1 @@ -9,6 +9,11 @@ BeforeAll { } Describe 'Get-StartMenuUserNameFromPath' { + BeforeEach { + # Restore copies are named to the second; clear them so tests sharing $TestDrive cannot see each other's copy + Get-ChildItem -LiteralPath $TestDrive -Filter 'Win11Debloat-StartRestore-*.bak' | Remove-Item -Force + } + It 'extracts a user name from a start-menu path and falls back for unknown paths' { Get-StartMenuUserNameFromPath -StartMenuBinFile 'C:\Users\Alice\AppData\Local\Packages\Start\start2.bin' | Should -Be 'Alice' Get-StartMenuUserNameFromPath -StartMenuBinFile 'C:\Temp\start2.bin' | Should -Be 'unknown'