Search in sources :

Example 1 with NodeJSInstaller

use of jenkins.plugins.nodejs.tools.NodeJSInstaller in project configuration-as-code-plugin by jenkinsci.

the class NodeJSTest method configure_nodejs.

@Test
@ConfiguredWithReadme("nodejs/README.md")
public void configure_nodejs() {
    final NodeJSInstallation.DescriptorImpl descriptor = ExtensionList.lookupSingleton(NodeJSInstallation.DescriptorImpl.class);
    assertEquals(1, descriptor.getInstallations().length);
    final NodeJSInstallation nodejs = descriptor.getInstallations()[0];
    final InstallSourceProperty installSourceProperty = nodejs.getProperties().get(InstallSourceProperty.class);
    final NodeJSInstaller nodeJSInstaller = installSourceProperty.installers.get(NodeJSInstaller.class);
    assertEquals("12.11.1", nodeJSInstaller.id);
    assertEquals(48, nodeJSInstaller.getNpmPackagesRefreshHours().longValue());
}
Also used : NodeJSInstallation(jenkins.plugins.nodejs.tools.NodeJSInstallation) InstallSourceProperty(hudson.tools.InstallSourceProperty) NodeJSInstaller(jenkins.plugins.nodejs.tools.NodeJSInstaller) Test(org.junit.Test) ConfiguredWithReadme(io.jenkins.plugins.casc.misc.ConfiguredWithReadme)

Aggregations

InstallSourceProperty (hudson.tools.InstallSourceProperty)1 ConfiguredWithReadme (io.jenkins.plugins.casc.misc.ConfiguredWithReadme)1 NodeJSInstallation (jenkins.plugins.nodejs.tools.NodeJSInstallation)1 NodeJSInstaller (jenkins.plugins.nodejs.tools.NodeJSInstaller)1 Test (org.junit.Test)1