JavaScript: Add test where outDir resolves to an unwanted path

This commit is contained in:
Taus
2025-07-11 14:58:03 +00:00
parent 2f822cb0cd
commit 30f705822d

View File

@@ -265,6 +265,21 @@ public class AutoBuildTests {
runTest();
}
@Test
public void skipFilesInTsconfigOutDirWithRelativePath() throws IOException {
// Test that outDir with relative path "somedir/.." (resolves to root) is ignored
addFile(true, LGTM_SRC, "tsconfig.json");
Path config = Paths.get(LGTM_SRC.toString(), "tsconfig.json");
Files.write(config,
"{\"compilerOptions\":{\"outDir\":\"somedir/..\"}}".getBytes(StandardCharsets.UTF_8));
// All files should be extracted since outDir resolving to root should be ignored
addFile(true, LGTM_SRC, "src", "app.ts");
addFile(true, LGTM_SRC, "main.js");
runTest();
}
@Test
public void includeFile() throws IOException {
envVars.put("LGTM_INDEX_INCLUDE", "tst.js");