Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Siavosh Kasravi committed Dec 11, 2024
1 parent 6fe62db commit 2468156
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/dyff/compare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,19 @@ listY: [ Yo, Yo, Yo ]

Expect(report.ExcludeRegexp("/does/not/exist")).To(BeEquivalentTo(report))
})

It("should ignore changes in values", func() {
report := dyff.Report{Diffs: []dyff.Diff{
singleDiff("/yaml/map/add", dyff.ADDITION, nil, "added"),
singleDiff("/yaml/map/removed", dyff.REMOVAL, nil, "removed"),
singleDiff("/yaml/map/changed", dyff.MODIFICATION, "foobar", "barfoo"),
}}

Expect(report.IgnoreValueChanges()).To(BeEquivalentTo(dyff.Report{Diffs: []dyff.Diff{
singleDiff("/yaml/map/add", dyff.ADDITION, nil, "added"),
singleDiff("/yaml/map/removed", dyff.REMOVAL, nil, "removed"),
}}))
})
})

Context("change root for comparison", func() {
Expand Down

0 comments on commit 2468156

Please sign in to comment.