mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
JavaScript: Add test where outDir resolves to an unwanted path
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user