mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
74e0ca3f49
PR-URL: https://github.com/nodejs/node/pull/49125 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
16 lines
409 B
JavaScript
16 lines
409 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const fs = require('fs');
|
|
const assert = require('assert');
|
|
const tmpdir = require('../common/tmpdir');
|
|
const writeFile = tmpdir.resolve('write-autoClose.txt');
|
|
tmpdir.refresh();
|
|
|
|
const file = fs.createWriteStream(writeFile, { autoClose: true });
|
|
|
|
file.on('finish', common.mustCall(() => {
|
|
assert.strictEqual(file.destroyed, false);
|
|
}));
|
|
file.end('asd');
|