Skip to content

Commit

Permalink
Node 8 changed the .destroy method to ._destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Nov 8, 2017
1 parent b82b525 commit 4b21b97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/file-operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ WriteStream.prototype.open = function() {
// Use our `end` method since it is patched for flush
WriteStream.prototype.destroySoon = WriteStream.prototype.end;
// Use node's `fs.WriteStream` methods
WriteStream.prototype._destroy = fs.WriteStream.prototype._destroy;
WriteStream.prototype.destroy = fs.WriteStream.prototype.destroy;
WriteStream.prototype.close = fs.WriteStream.prototype.close;

Expand Down
4 changes: 4 additions & 0 deletions test/file-operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,8 @@ describe('reflectStat', function() {
fs.stat(symlinkPath, function(err, stat) {
expect(file.stat).toEqual(stat);

fs.unlinkSync(symlinkPath);

done();
});
});
Expand Down Expand Up @@ -969,6 +971,8 @@ describe('reflectLinkStat', function() {
fs.lstat(symlinkPath, function(err, stat) {
expect(file.stat).toEqual(stat);

fs.unlinkSync(symlinkPath);

done();
});
});
Expand Down

0 comments on commit 4b21b97

Please sign in to comment.