0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-stream-writable-aborted.js
Robert Nagy 415726b8c4 stream: add writableAborted
PR-URL: https://github.com/nodejs/node/pull/40802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-11-18 07:40:13 +01:00

27 lines
521 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const { Writable } = require('stream');
{
const writable = new Writable({
write() {
}
});
assert.strictEqual(writable.writableAborted, false);
writable.destroy();
assert.strictEqual(writable.writableAborted, true);
}
{
const writable = new Writable({
write() {
}
});
assert.strictEqual(writable.writableAborted, false);
writable.end();
writable.destroy();
assert.strictEqual(writable.writableAborted, true);
}