Skip to content

Commit

Permalink
devonfw#608: fixed tests
Browse files Browse the repository at this point in the history
fixed DotNet test
added run test to NpmTest
removed unused test resource files
renamed readme files to .gitkeep
  • Loading branch information
jan-vcapgemini committed Oct 8, 2024
1 parent 20bd7c6 commit 7a0433a
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void dotnetShouldInstallSuccessful(String os) {
assertThat(this.context.getSoftwarePath().resolve("dotnet")).exists();

if (this.context.getSystemInfo().isWindows()) {
assertThat(this.context.getSoftwarePath().resolve("dotnet/dotnet.cmd")).exists();
assertThat(this.context.getSoftwarePath().resolve("dotnet/dotnet.exe")).exists();
}

if (this.context.getSystemInfo().isLinux() || this.context.getSystemInfo().isMac()) {
Expand Down
22 changes: 22 additions & 0 deletions cli/src/test/java/com/devonfw/tools/ide/tool/npm/NpmTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@ public void testNpmInstall(String os) {
checkInstallation(context);
}

@ParameterizedTest
@ValueSource(strings = { "windows", "mac", "linux" })
public void testNpmRun(String os) {

// arrange
IdeTestContext context = newContext(PROJECT_NPM);
SystemInfo systemInfo = SystemInfoMock.of(os);
context.setSystemInfo(systemInfo);
Npm commandlet = new Npm(context);

// act
commandlet.run();

// assert
if (context.getSystemInfo().isWindows()) {
assertThat(context).logAtInfo().hasMessage("npmcmdbin ");
} else {
assertThat(context).logAtInfo().hasMessage("npmcmd ");
}

}

private void checkInstallation(IdeTestContext context) {

if (context.getSystemInfo().isWindows()) {
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
node "npm"
echo "npm windows $*"
echo "npm linux $*"

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
node "npm"
echo "npm windows $*"
echo "npm mac $*"

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
call node npm
echo npm windows %*
#!/bin/bash
node "npm"
echo "npm windows $*"
Empty file.

0 comments on commit 7a0433a

Please sign in to comment.