0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 07:53:06 +01:00
nodejs/test/pseudo-tty/test-tty-stream-constructors.js

22 lines
511 B
JavaScript
Raw Normal View History

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