Skip to content

Commit 32b5361

Browse files
authoredMay 23, 2023
fix: don't print empty diff (#3437)
1 parent 41e11da commit 32b5361

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎packages/utils/src/diff.ts

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ export function unifiedDiff(actual: unknown, expected: unknown, options: DiffOpt
3535
counts['-']++
3636
})
3737

38+
if (counts['+'] === 0 && counts['-'] === 0)
39+
return ''
40+
3841
let legend = ''
3942

4043
if (showLegend) {

0 commit comments

Comments
 (0)
Please sign in to comment.