Skip to content

Commit

Permalink
Add unit test for binary file diff
Browse files Browse the repository at this point in the history
  • Loading branch information
steveukx committed Jul 1, 2019
1 parent 9a3ecd7 commit b6b8067
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/unit/test-diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,18 @@ exports.diff = {

test.done();
},

'recognises binary files' (test) {

const summary = DiffSummary.parse(`
some/image.png | Bin 0 -> 9806 bytes
1 file changed, 1 insertion(+)
`);

test.deepEqual(summary.files, [
{ file: 'some/image.png', before: 0, after: 9806, binary: true },
]);

test.done();
},
};

0 comments on commit b6b8067

Please sign in to comment.