mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user