mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
Manually fix issues that eslint --fix couldn't do automatically. Backport-PR-URL: https://github.com/nodejs/node/pull/11775 PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
25 lines
642 B
JavaScript
25 lines
642 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
|
|
common.refreshTmpDir();
|
|
|
|
{
|
|
const file = path.join(common.tmpDir, 'write-end-test0.txt');
|
|
const stream = fs.createWriteStream(file);
|
|
stream.end();
|
|
stream.on('close', common.mustCall(function() { }));
|
|
}
|
|
|
|
{
|
|
const file = path.join(common.tmpDir, 'write-end-test1.txt');
|
|
const stream = fs.createWriteStream(file);
|
|
stream.end('a\n', 'utf8');
|
|
stream.on('close', common.mustCall(function() {
|
|
const content = fs.readFileSync(file, 'utf8');
|
|
assert.strictEqual(content, 'a\n');
|
|
}));
|
|
}
|