From 42cc50d0fd3ac71663b89f89617f22e5bc44d370 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sat, 7 Mar 2026 20:35:35 +0800 Subject: [PATCH] test(purge): cover empty menu options path --- tests/purge.bats | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/purge.bats b/tests/purge.bats index 0137f7a..9895373 100644 --- a/tests/purge.bats +++ b/tests/purge.bats @@ -683,6 +683,25 @@ EOF [[ "$status" -eq 0 ]] || [[ "$status" -eq 2 ]] } +@test "clean_project_artifacts: handles empty menu options under set -u" { + run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc <<'EOF' +set -euo pipefail +source "$PROJECT_ROOT/lib/core/common.sh" +source "$PROJECT_ROOT/lib/clean/project.sh" + +mkdir -p "$HOME/www/test-project/node_modules" +touch "$HOME/www/test-project/package.json" + +PURGE_SEARCH_PATHS=("$HOME/www") +get_dir_size_kb() { echo 0; } + +clean_project_artifacts