@Test public void should_use_absolute_path_from_property() throws Exception { Path baseDir = tempFolder.newDir().toPath(); Files.createFile(baseDir.resolve("custom.tsconfig.json")); SensorContextTester ctx = SensorContextTester.create(baseDir); String absolutePath = baseDir.resolve("custom.tsconfig.json").toAbsolutePath().toString(); ctx.setSettings(new MapSettings().setProperty("sonar.typescript.tsconfigPath", absolutePath)); createInputFile(ctx, "file.ts"); List<String> tsconfigs = new TsConfigProvider(tempFolder).tsconfigs(ctx); assertThat(tsconfigs).containsExactly(absolutePath); }
List<String> tsconfigs(SensorContext context) throws IOException { for (Provider provider : providers) { List<String> tsconfigs = provider.tsconfigs(context); if (!tsconfigs.isEmpty()) { return tsconfigs; } } return emptyList(); }
TsConfigProvider { List<String> tsconfigs(SensorContext context) throws IOException { for (Provider provider : providers) { List<String> tsconfigs = provider.tsconfigs(context); if (!tsconfigs.isEmpty()) { return tsconfigs; } } return emptyList(); } }
TsConfigProvider { List<String> tsconfigs(SensorContext context) throws IOException { for (Provider provider : providers) { List<String> tsconfigs = provider.tsconfigs(context); if (!tsconfigs.isEmpty()) { return tsconfigs; } } return emptyList(); } TsConfigProvider(TempFolder folder); }
TsConfigProvider { List<String> tsconfigs(SensorContext context) throws IOException { for (Provider provider : providers) { List<String> tsconfigs = provider.tsconfigs(context); if (!tsconfigs.isEmpty()) { return tsconfigs; } } return emptyList(); } TsConfigProvider(TempFolder folder);  }
TsConfigProvider { List<String> tsconfigs(SensorContext context) throws IOException { for (Provider provider : providers) { List<String> tsconfigs = provider.tsconfigs(context); if (!tsconfigs.isEmpty()) { return tsconfigs; } } return emptyList(); } TsConfigProvider(TempFolder folder);   }