• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3require('../common');
4const { strictEqual } = require('assert');
5const { isatty } = require('tty');
6
7strictEqual(isatty(0), true, 'stdin reported to not be a tty, but it is');
8strictEqual(isatty(1), true, 'stdout reported to not be a tty, but it is');
9strictEqual(isatty(2), true, 'stderr reported to not be a tty, but it is');
10
11strictEqual(isatty(-1), false, '-1 reported to be a tty, but it is not');
12strictEqual(isatty(55555), false, '55555 reported to be a tty, but it is not');
13strictEqual(isatty(2 ** 31), false, '2^31 reported to be a tty, but it is not');
14strictEqual(isatty(1.1), false, '1.1 reported to be a tty, but it is not');
15strictEqual(isatty('1'), false, '\'1\' reported to be a tty, but it is not');
16strictEqual(isatty({}), false, '{} reported to be a tty, but it is not');
17strictEqual(isatty(() => {}), false,
18            '() => {} reported to be a tty, but it is not');
19