FrontendTools { public List<String> getPnpmExecutable() { Supplier<List<String>> result = doEnsurePnpm(); List<String> pnpmCommand = result.get(); if (!pnpmCommand.isEmpty()) { pnpmCommand.add("--shamefully-hoist=true"); } return pnpmCommand; } FrontendTools(String baseDir,
            Supplier<String> alternativeDirGetter);  FrontendTools(String baseDir,
                         Supplier<String> alternativeDirGetter,
                         String nodeVersion,
                         URI nodeDownloadRoot);   FrontendTools(String baseDir, Supplier<String> alternativeDirGetter,
            String nodeVersion, URI nodeDownloadRoot,
            boolean ignoreVersionChecks); String getNodeExecutable(); String forceAlternativeNodeExecutable(); List<String> getNpmExecutable(); List<String> getPnpmExecutable(); void ensurePnpm(); void validateNodeAndNpmVersion(); static final String DEFAULT_NODE_VERSION; static final String DEFAULT_PNPM_VERSION; static final String INSTALL_NODE_LOCALLY; static final int SUPPORTED_PNPM_MAJOR_VERSION; static final int SUPPORTED_PNPM_MINOR_VERSION; }
@Test public void getPnpmExecutable_executableIsAvailable() { List<String> executable = tools.getPnpmExecutable(); Assert.assertTrue(executable.contains("--shamefully-hoist=true")); Assert.assertTrue( executable.stream().anyMatch(cmd -> cmd.contains("pnpm"))); }
@Test public void getPnpmExecutable_pnpmIsNotInstalledGlobally_pnpmIsInstalledInHome() { List<String> executable = tools.getPnpmExecutable(baseDir, false); Assume.assumeTrue(executable.isEmpty()); executable = tools.getPnpmExecutable(); Assert.assertThat(executable.get(1), CoreMatchers.startsWith(vaadinHomeDir)); }