@Test public void should_validate_tsconfig_from_property() throws Exception { SensorContextTester ctx = SensorContextTester.create(baseDir); ctx.setSettings(new MapSettings().setProperty("sonar.typescript.tsconfigPath", "custom.tsconfig.json")); createInputFile(ctx, "file.ts"); String absolutePath = baseDir.resolve("custom.tsconfig.json").toAbsolutePath().toString(); assertThatThrownBy(() -> new TsConfigProvider(tempFolder).tsconfigs(ctx)) .isInstanceOf(IllegalStateException.class) .hasMessage("Provided tsconfig.json path doesn't exist. Path: '" + 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);   }