mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
PR-URL: https://github.com/nodejs/node/pull/60125 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
18 lines
804 B
JavaScript
18 lines
804 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { isatty } = require('tty');
|
|
|
|
assert.ok(isatty(0), 'stdin reported to not be a tty, but it is');
|
|
assert.ok(isatty(1), 'stdout reported to not be a tty, but it is');
|
|
assert.ok(isatty(2), 'stderr reported to not be a tty, but it is');
|
|
|
|
assert.ok(!isatty(-1), '-1 reported to be a tty, but it is not');
|
|
assert.ok(!isatty(55555), '55555 reported to be a tty, but it is not');
|
|
assert.ok(!isatty(2 ** 31), '2^31 reported to be a tty, but it is not');
|
|
assert.ok(!isatty(1.1), '1.1 reported to be a tty, but it is not');
|
|
assert.ok(!isatty('1'), '\'1\' reported to be a tty, but it is not');
|
|
assert.ok(!isatty({}), '{} reported to be a tty, but it is not');
|
|
assert.ok(!isatty(() => {}), '() => {} reported to be a tty, but it is not');
|