node/test/parallel/test-fs-read-stream-patch-open.js
Robert Nagy 54b36e401d fs: reimplement read and write streams using stream.construct
Refs: #23133

PR-URL: https://github.com/nodejs/node/pull/29656
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-05-27 10:24:33 +02:00

18 lines
444 B
JavaScript

'use strict';
const common = require('../common');
const fs = require('fs');
common.expectWarning(
'DeprecationWarning',
'ReadStream.prototype.open() is deprecated', 'DEP0135');
const s = fs.createReadStream('asd')
// We don't care about errors in this test.
.on('error', () => {});
s.open();
process.nextTick(() => {
// Allow overriding open().
fs.ReadStream.prototype.open = common.mustCall();
fs.createReadStream('asd');
});