mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
8be9d68457
Update vars to const/let & equal to strictEqual. PR-URL: https://github.com/nodejs/node/pull/9927 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
32 lines
599 B
JavaScript
32 lines
599 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const file = path.join(common.fixturesDir, 'x.txt');
|
|
let data = '';
|
|
let first = true;
|
|
|
|
var stream = fs.createReadStream(file);
|
|
stream.setEncoding('utf8');
|
|
stream.on('data', function(chunk) {
|
|
data += chunk;
|
|
if (first) {
|
|
first = false;
|
|
stream.resume();
|
|
}
|
|
});
|
|
|
|
process.nextTick(function() {
|
|
stream.pause();
|
|
setTimeout(function() {
|
|
stream.resume();
|
|
}, 100);
|
|
});
|
|
|
|
process.on('exit', function() {
|
|
assert.strictEqual(data, 'xyz\n');
|
|
});
|