use of com.vaadin.flow.server.frontend.scanner.FrontendDependencies in project flow by vaadin.
the class AbstractNodeUpdatePackagesTest method generatePackageJson_addedDependencies_updaterIsModified.
@Test
public void generatePackageJson_addedDependencies_updaterIsModified() {
FrontendDependencies frontendDependencies = Mockito.mock(FrontendDependencies.class);
Map<String, String> packages = new HashMap<>();
packages.put("@polymer/iron-list", "3.0.2");
packages.put("@vaadin/vaadin-confirm-dialog", "1.1.4");
packages.put("@vaadin/vaadin-checkbox", "2.2.10");
packages.put("@polymer/iron-icon", "3.0.1");
packages.put("@vaadin/vaadin-time-picker", "2.0.2");
Mockito.when(frontendDependencies.getPackages()).thenReturn(packages);
packageUpdater = new TaskUpdatePackages(classFinder, frontendDependencies, baseDir, generatedDir, resourcesDir, false, false, TARGET, featureFlags);
packageCreator.execute();
packageUpdater.execute();
packages.put("@vaadin/vaadin-list-box", "1.1.1");
packageUpdater.execute();
Assert.assertTrue("Modification flag should be true when dependency added.", packageUpdater.modified);
}
use of com.vaadin.flow.server.frontend.scanner.FrontendDependencies in project flow by vaadin.
the class TaskUpdatePackagesNpmTest method createTask.
private TaskUpdatePackages createTask(Map<String, String> applicationDependencies, boolean enablePnpm) {
final FrontendDependencies frontendDependenciesScanner = Mockito.mock(FrontendDependencies.class);
Mockito.when(frontendDependenciesScanner.getPackages()).thenReturn(applicationDependencies);
return new TaskUpdatePackages(finder, frontendDependenciesScanner, npmFolder, generatedPath, null, false, enablePnpm, TARGET, Mockito.mock(FeatureFlags.class)) {
};
}
Aggregations