From f09d3e5a1bfbbf6308856707138296c686009477 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Thu, 25 Jan 2024 08:42:33 +0100 Subject: [PATCH] test(node): Compare deeply nested data classes by YAML representation This eases to see the differences in console output. Signed-off-by: Sebastian Schuberth --- .../node/src/funTest/kotlin/NpmVersionUrlFunTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/package-managers/node/src/funTest/kotlin/NpmVersionUrlFunTest.kt b/plugins/package-managers/node/src/funTest/kotlin/NpmVersionUrlFunTest.kt index a99c1a80bea64..63beb17d2f30a 100644 --- a/plugins/package-managers/node/src/funTest/kotlin/NpmVersionUrlFunTest.kt +++ b/plugins/package-managers/node/src/funTest/kotlin/NpmVersionUrlFunTest.kt @@ -27,6 +27,7 @@ import org.ossreviewtoolkit.analyzer.managers.resolveSingleProject import org.ossreviewtoolkit.analyzer.managers.withInvariantIssues import org.ossreviewtoolkit.model.ProjectAnalyzerResult import org.ossreviewtoolkit.model.fromYaml +import org.ossreviewtoolkit.model.yamlMapper import org.ossreviewtoolkit.utils.test.getAssetFile import org.ossreviewtoolkit.utils.test.patchExpectedResult @@ -41,7 +42,8 @@ class NpmVersionUrlFunTest : WordSpec({ val actualResult = create("NPM", allowDynamicVersions = true) .resolveSingleProject(definitionFile, resolveScopes = true) - actualResult.withInvariantIssues() shouldBe expectedResult.withInvariantIssues() + yamlMapper.writeValueAsString(actualResult.withInvariantIssues()) shouldBe + yamlMapper.writeValueAsString(expectedResult.withInvariantIssues()) } } })