diff options
Diffstat (limited to 'test/parallel/test-fs-read-stream-patch-open.js')
-rw-r--r-- | test/parallel/test-fs-read-stream-patch-open.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/parallel/test-fs-read-stream-patch-open.js b/test/parallel/test-fs-read-stream-patch-open.js new file mode 100644 index 0000000000..80f8888de3 --- /dev/null +++ b/test/parallel/test-fs-read-stream-patch-open.js @@ -0,0 +1,15 @@ +'use strict'; +const common = require('../common'); +const fs = require('fs'); + +common.expectWarning( + 'DeprecationWarning', + 'ReadStream.prototype.open() is deprecated', 'DEP0XXX'); +const s = fs.createReadStream('asd') + // We don't care about errors in this test. + .on('error', () => {}); +s.open(); + +// Allow overriding open(). +fs.ReadStream.prototype.open = common.mustCall(); +fs.createReadStream('asd'); |