mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
134fb5a8d0
Fixes: https://github.com/nodejs/node/issues/37805 PR-URL: https://github.com/nodejs/node/pull/37809 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
19 lines
905 B
JavaScript
19 lines
905 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const { strictEqual } = require('assert');
|
|
const { isatty } = require('tty');
|
|
|
|
strictEqual(isatty(0), true, 'stdin reported to not be a tty, but it is');
|
|
strictEqual(isatty(1), true, 'stdout reported to not be a tty, but it is');
|
|
strictEqual(isatty(2), true, 'stderr reported to not be a tty, but it is');
|
|
|
|
strictEqual(isatty(-1), false, '-1 reported to be a tty, but it is not');
|
|
strictEqual(isatty(55555), false, '55555 reported to be a tty, but it is not');
|
|
strictEqual(isatty(2 ** 31), false, '2^31 reported to be a tty, but it is not');
|
|
strictEqual(isatty(1.1), false, '1.1 reported to be a tty, but it is not');
|
|
strictEqual(isatty('1'), false, '\'1\' reported to be a tty, but it is not');
|
|
strictEqual(isatty({}), false, '{} reported to be a tty, but it is not');
|
|
strictEqual(isatty(() => {}), false,
|
|
'() => {} reported to be a tty, but it is not');
|