Skip to content

Commit 81bb07a

Browse files
committed
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.
1 parent 105213d commit 81bb07a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,10 @@ public int run() throws IOException {
490490
}
491491

492492
// Fail extraction if no relevant files were found.
493-
if (!seenFiles || !hasSeenCode() && !EnvironmentVariables.isActionsExtractor()) {
493+
boolean seenRelevantFiles = EnvironmentVariables.isActionsExtractor()
494+
? seenFiles // assume all files are relevant for Actions extractor
495+
: hasSeenCode();
496+
if (!seenRelevantFiles) {
494497
if (seenFiles) {
495498
warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors.");
496499
} else {

0 commit comments

Comments
 (0)