diff --git a/packages/java/engine-runtime/src/test/java/com/vaadin/hilla/internal/TaskTest.java b/packages/java/engine-runtime/src/test/java/com/vaadin/hilla/internal/TaskTest.java index db0a3e1c3f..ffab51e38d 100644 --- a/packages/java/engine-runtime/src/test/java/com/vaadin/hilla/internal/TaskTest.java +++ b/packages/java/engine-runtime/src/test/java/com/vaadin/hilla/internal/TaskTest.java @@ -41,13 +41,17 @@ public void setUpTaskApplication() throws IOException, URISyntaxException, .resolve(getFrontendDirectory()); Files.createDirectories(frontendDir); - var packagesDirectory = Path + Path packagesPath = Path .of(getClass().getClassLoader().getResource("").toURI()) .getParent() // target .getParent() // engine-runtime .getParent() // java - .getParent() // packages - .resolve("ts"); + .getParent(); // packages + + Path projectRoot = packagesPath.getParent(); + Files.copy(projectRoot.resolve(".npmrc"), + temporaryDirectory.resolve(".npmrc")); + var tsPackagesDirectory = packagesPath.resolve("ts"); var shellCmd = FrontendUtils.isWindows() ? Stream.of("cmd.exe", "/c") : Stream. empty(); @@ -55,7 +59,8 @@ public void setUpTaskApplication() throws IOException, URISyntaxException, var npmCmd = Stream.of("npm", "--no-update-notifier", "--no-audit", "install", "--no-save", "--install-links"); - var generatorFiles = Files.list(packagesDirectory).map(Path::toString); + var generatorFiles = Files.list(tsPackagesDirectory) + .map(Path::toString); var command = Stream.of(shellCmd, npmCmd, generatorFiles) .flatMap(Function.identity()).toList();