use of org.sonarsource.sonarlint.core.NodeJsHelper in project sonarlint-core by SonarSource.
the class ConnectedIssueMediumTests method prepare.
@BeforeAll
static void prepare(@TempDir Path slHome) throws Exception {
var storage = newStorage(SERVER_ID).withJSPlugin().withJavaPlugin().withProject("test-project").withProject(JAVA_MODULE_KEY, project -> project.withRuleSet("java", ruleSet -> ruleSet.withActiveRule("java:S106", "MAJOR").withActiveRule("java:S1220", "MINOR").withActiveRule("java:S1481", "BLOCKER"))).withProject("stale_module", ProjectStorageFixture.ProjectStorageBuilder::stale).create(slHome);
var nodeJsHelper = new NodeJsHelper();
nodeJsHelper.detect(null);
var config = ConnectedGlobalConfiguration.builder().setConnectionId(SERVER_ID).setSonarLintUserHome(slHome).setStorageRoot(storage.getPath()).setLogOutput(createNoOpLogOutput()).addEnabledLanguages(Language.JAVA, Language.JS).setNodeJs(nodeJsHelper.getNodeJsPath(), nodeJsHelper.getNodeJsVersion()).setModulesProvider(() -> List.of(new ClientModuleInfo("key", mock(ClientModuleFileSystem.class)))).build();
sonarlint = new ConnectedSonarLintEngineImpl(config);
}
Aggregations