mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 23:43:09 +01:00
4b5a8160a4
PR-URL: https://github.com/nodejs/node/pull/16959 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
22 lines
511 B
JavaScript
22 lines
511 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { ReadStream, WriteStream } = require('tty');
|
|
|
|
{
|
|
// Verify that tty.ReadStream can be constructed without new.
|
|
const stream = ReadStream(0);
|
|
|
|
stream.unref();
|
|
assert(stream instanceof ReadStream);
|
|
assert.strictEqual(stream.isTTY, true);
|
|
}
|
|
|
|
{
|
|
// Verify that tty.WriteStream can be constructed without new.
|
|
const stream = WriteStream(1);
|
|
|
|
assert(stream instanceof WriteStream);
|
|
assert.strictEqual(stream.isTTY, true);
|
|
}
|