JS: Fix check to account for override in tests

The code was written on the assumption that 'seenCode' implies 'seenFiles' but the unit test override 'hasSeenCode()' to always return true. Which meant we would start taking this branch in the unit tests.
This commit is contained in:
Asger F
2025-11-04 11:45:20 +01:00
parent 105213df03
commit 81bb07a7ba

View File

@@ -490,7 +490,10 @@ public class AutoBuild {
}
// Fail extraction if no relevant files were found.
if (!seenFiles || !hasSeenCode() && !EnvironmentVariables.isActionsExtractor()) {
boolean seenRelevantFiles = EnvironmentVariables.isActionsExtractor()
? seenFiles // assume all files are relevant for Actions extractor
: hasSeenCode();
if (!seenRelevantFiles) {
if (seenFiles) {
warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors.");
} else {