test: add mustCallAtLeast to test-fs-read-stream-fd test

PR-URL: https://github.com/nodejs/node/pull/27461
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
hardfist 2019-04-28 16:57:43 +08:00 committed by ZYSzys
parent 274364580a
commit 4cf8b4212c

View File

@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../common');
const common = require('../common');
const fs = require('fs');
const assert = require('assert');
const path = require('path');
@ -35,9 +35,9 @@ fs.writeFileSync(file, input);
const fd = fs.openSync(file, 'r');
const stream = fs.createReadStream(null, { fd: fd, encoding: 'utf8' });
stream.on('data', (data) => {
stream.on('data', common.mustCallAtLeast((data) => {
output += data;
});
}));
process.on('exit', () => {
assert.strictEqual(output, input);