Skip to content

Commit 66057e6

Browse files
committed
Test to check errors on applyPatches.complete
1 parent c45c703 commit 66057e6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/patch/apply.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,26 @@ describe('patch/apply', function() {
534534
+ 'foo5\n'
535535
};
536536

537+
it('should handle errors on complete', function(done) {
538+
const expected = new Error();
539+
540+
applyPatches(patch, {
541+
loadFile(index, callback) {
542+
callback(undefined, contents[index.index]);
543+
},
544+
patched(index, content, callback) {
545+
callback(expected);
546+
},
547+
complete(err) {
548+
expect(err)
549+
.to.equal(expected)
550+
.to.not.be.undefined;
551+
552+
done();
553+
}
554+
});
555+
});
556+
537557
it('should handle multiple files', function(done) {
538558
applyPatches(patch, {
539559
loadFile(index, callback) {

0 commit comments

Comments
 (0)