@Test public void should_lookup_tsconfig_files() throws Exception { Path tsconfig1 = baseDir.resolve("tsconfig.json"); Files.createFile(tsconfig1); Path subdir = baseDir.resolve("subdir"); Files.createDirectory(subdir); Files.createDirectory(subdir.resolve("node_modules")); Path tsconfig2 = Files.createFile(subdir.resolve("tsconfig.json")); Files.createFile(subdir.resolve("node_modules/tsconfig.json")); Files.createFile(subdir.resolve("base.tsconfig.json")); SensorContextTester ctx = SensorContextTester.create(baseDir); createInputFile(ctx, "file1.ts"); createInputFile(ctx, "file2.ts"); List<String> tsconfigs = new TsConfigProvider(tempFolder).tsconfigs(ctx); assertThat(tsconfigs).containsExactlyInAnyOrder(tsconfig1.toAbsolutePath().toString(), tsconfig2.toAbsolutePath().toString()); }
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);   }