Skip to content

Commit e5491cb

Browse files
committed
Access WriteStream of fs during runtime instead of include time
This adds compatibility with mock-fs [1], which overrides these methods and expects modules to access them thereafter. [1] https://github.com/tschaub/mock-fs
1 parent d93055d commit e5491cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/file.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if (global.GENTLY) require = GENTLY.hijack(require);
22

33
var util = require('util'),
4-
WriteStream = require('fs').WriteStream,
4+
fs = require('fs'),
55
EventEmitter = require('events').EventEmitter,
66
crypto = require('crypto');
77

@@ -31,7 +31,7 @@ module.exports = File;
3131
util.inherits(File, EventEmitter);
3232

3333
File.prototype.open = function() {
34-
this._writeStream = new WriteStream(this.path);
34+
this._writeStream = new fs.WriteStream(this.path);
3535
};
3636

3737
File.prototype.toJSON = function() {

0 commit comments

Comments
 (0)