From a37ca245ff3939069218127794a1a2935e536f05 Mon Sep 17 00:00:00 2001 From: hardfist <1562502418@qq.com> Date: Sun, 28 Apr 2019 16:57:43 +0800 Subject: [PATCH] test: add mustCallAtLeast to test-fs-read-stream-fd test PR-URL: https://github.com/nodejs/node/pull/27461 Reviewed-By: Weijia Wang Reviewed-By: Yorkie Liu Reviewed-By: Yongsheng Zhang Reviewed-By: Colin Ihrig Reviewed-By: Anto Aravinth Reviewed-By: Rich Trott --- test/parallel/test-fs-read-stream-fd.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-fs-read-stream-fd.js b/test/parallel/test-fs-read-stream-fd.js index 7d4b264002b9f3..ddb62799ace034 100644 --- a/test/parallel/test-fs-read-stream-fd.js +++ b/test/parallel/test-fs-read-stream-fd.js @@ -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);