@Test public void should_create_tsconfig() throws Exception { SensorContextTester ctx = SensorContextTester.create(baseDir); createInputFile(ctx, "file1.ts"); createInputFile(ctx, "file2.ts"); List<String> tsconfigs = new TsConfigProvider(tempFolder).tsconfigs(ctx); assertThat(tsconfigs).hasSize(1); String tsconfig = new String(Files.readAllBytes(Paths.get(tsconfigs.get(0))), StandardCharsets.UTF_8); assertThat(tsconfig).isEqualTo("{\"files\":[\"moduleKey/file1.ts\",\"moduleKey/file2.ts\"],\"compilerOptions\":{}}"); }
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);   }