Skip to content

Commit

Permalink
test(node): Simplify a test setup
Browse files Browse the repository at this point in the history
Do not use the constant for the empty value as this can be misleading
one into thinking there may be special handling for that. So, use an
arbitrary string as for the VCS path.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Apr 12, 2024
1 parent 1402082 commit 42821bb
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import io.kotest.core.spec.style.WordSpec
import io.kotest.inspectors.forAll
import io.kotest.matchers.shouldBe

import org.ossreviewtoolkit.model.HashAlgorithm
import org.ossreviewtoolkit.model.VcsInfo
import org.ossreviewtoolkit.model.VcsType

Expand Down Expand Up @@ -196,7 +195,7 @@ class NpmSupportTest : WordSpec({
@Suppress("Wrapping")
val node = ObjectMapper().run {
createObjectNode().apply {
replace("gitHead", TextNode(HashAlgorithm.SHA1GIT.emptyValue))
replace("gitHead", TextNode("bar"))
replace("repository", createObjectNode().apply {
replace("type", TextNode("Git"))
replace("url", TextNode("https://example.com/"))
Expand All @@ -208,7 +207,7 @@ class NpmSupportTest : WordSpec({
parseNpmVcsInfo(node) shouldBe VcsInfo(
VcsType.GIT,
"https://example.com/",
HashAlgorithm.SHA1GIT.emptyValue,
"bar",
"foo"
)
}
Expand Down

0 comments on commit 42821bb

Please sign in to comment.