node/test/pseudo-tty/test-tty-stream-constructors.js
cjihrig 4b5a8160a4
test: add coverage to tty module
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>
2017-11-14 17:32:45 -05:00

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);
}