Skip to content

Commit

Permalink
test(node): Compare deeply nested data classes by YAML representation
Browse files Browse the repository at this point in the history
This eases to see the differences in console output.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jan 25, 2024
1 parent edbb3ad commit f09d3e5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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())
}
}
})

0 comments on commit f09d3e5

Please sign in to comment.