summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhardfist <1562502418@qq.com>2019-04-28 16:57:43 +0800
committerZYSzys <zyszys98@gmail.com>2019-04-29 13:19:26 +0800
commit4cf8b4212c9b6be3d606dbb4da94f56ac9dc756c (patch)
treee9c2b9f92907eda7f610e246c42f2290594ec749 /test
parent274364580a218f331b10e832d0face7a713bb8f0 (diff)
downloadandroid-node-v8-4cf8b4212c9b6be3d606dbb4da94f56ac9dc756c.tar.gz
android-node-v8-4cf8b4212c9b6be3d606dbb4da94f56ac9dc756c.tar.bz2
android-node-v8-4cf8b4212c9b6be3d606dbb4da94f56ac9dc756c.zip
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>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-fs-read-stream-fd.js6
1 files 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 7d4b264002..ddb62799ac 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);