Skip to content

Commit

Permalink
test: Use project .npmrc for tests (#3089)
Browse files Browse the repository at this point in the history
Makes it possible to use a custom registry for dependency testing
  • Loading branch information
Artur- authored Dec 30, 2024
1 parent 242f830 commit 5719651
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,26 @@ 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.<String> empty();

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();
Expand Down

0 comments on commit 5719651

Please sign in to comment.