From de4a80ef935bcd3f372ff29211188100114ba623 Mon Sep 17 00:00:00 2001 From: Andrew Rumble Date: Wed, 28 May 2025 14:24:59 +0100 Subject: [PATCH] Update unit test script to remove mocha module tests GitOrigin-RevId: 3bcc265e32486a179dd473233bed27ed798fba47 --- services/web/bin/test_unit_run_dir | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/services/web/bin/test_unit_run_dir b/services/web/bin/test_unit_run_dir index 50ab911b33..4d5d5ecb9a 100755 --- a/services/web/bin/test_unit_run_dir +++ b/services/web/bin/test_unit_run_dir @@ -3,25 +3,16 @@ declare -a vitest_args=("$@") has_mocha_test=0 -has_mocha_mjs_test=0 has_vitest_test=0 -mocha_mjs_dirs=() - for dir_path in "$@"; do if [ -n "$(find "$dir_path" -name "*.js" -type f -print -quit 2>/dev/null)" ]; then has_mocha_test=1 fi - if [ -n "$(find "$dir_path" -name "*Tests.mjs" -type f -print -quit 2>/dev/null)" ]; then - has_mocha_mjs_test=1 - mocha_mjs_dirs+=("$dir_path/**/*Tests.mjs") - fi - if [ -n "$(find "$dir_path" -name "*.test.mjs" -type f -print -quit 2>/dev/null)" ]; then has_vitest_test=1 fi - done if [[ -n "$MOCHA_GREP" ]]; then @@ -47,14 +38,7 @@ fi if (( has_mocha_test == 1 )); then mocha --recursive --timeout 25000 --exit --grep="$MOCHA_GREP" --require test/unit/bootstrap.js --extension=js "$@" mocha_status=$? -fi -# Remove this if/else when we have converted all module tests to vitest. -if (( has_mocha_mjs_test == 1)); then - mocha --recursive --timeout 25000 --exit --grep="$MOCHA_GREP" --require test/unit/bootstrap.js --extension=mjs "${mocha_mjs_dirs[@]}" - mocha_status=$((mocha_status != 0 ? mocha_status : $?)) -fi - -if (( has_mocha_mjs_test == 0 && has_mocha_test == 0 )); then +else echo "No mocha tests found in $TARGET_DIR, skipping mocha step." mocha_status=0 fi