diff options
Diffstat (limited to 'test/pseudo-tty')
-rw-r--r-- | test/pseudo-tty/test-tty-get-color-depth.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/pseudo-tty/test-tty-get-color-depth.js b/test/pseudo-tty/test-tty-get-color-depth.js index d4062f5fdb..14151ec3fb 100644 --- a/test/pseudo-tty/test-tty-get-color-depth.js +++ b/test/pseudo-tty/test-tty-get-color-depth.js @@ -3,6 +3,7 @@ const common = require('../common'); const assert = require('assert').strict; const { WriteStream } = require('tty'); +const { inspect } = require('util'); const fd = common.getTTYfd(); const writeStream = new WriteStream(fd); @@ -16,6 +17,8 @@ const writeStream = new WriteStream(fd); // Check different environment variables. [ [{ COLORTERM: '1' }, 4], + [{ COLORTERM: 'truecolor' }, 24], + [{ COLORTERM: '24bit' }, 24], [{ TMUX: '1' }, 8], [{ CI: '1' }, 1], [{ CI: '1', TRAVIS: '1' }, 8], @@ -29,7 +32,7 @@ const writeStream = new WriteStream(fd); [{ TERM_PROGRAM: 'iTerm.app', TERM_PROGRAM_VERSION: '3.0' }, 24], [{ TERM_PROGRAM: 'iTerm.app', TERM_PROGRAM_VERSION: '2.0' }, 8], [{ TERM_PROGRAM: 'HyperTerm' }, 24], - [{ TERM_PROGRAM: 'Hyper' }, 24], + [{ TERM_PROGRAM: 'Hyper' }, 1], [{ TERM_PROGRAM: 'MacTerm' }, 24], [{ TERM_PROGRAM: 'Apple_Terminal' }, 8], [{ TERM: 'xterm-256' }, 8], @@ -40,13 +43,16 @@ const writeStream = new WriteStream(fd); [{ TERM: 'fail' }, 1], [{ NODE_DISABLE_COLORS: '1' }, 1], [{ TERM: 'dumb' }, 1], - [{ TERM: 'dumb', COLORTERM: '1' }, 4], + [{ TERM: 'dumb', COLORTERM: '1' }, 1], + [{ TERM: 'terminator' }, 24], + [{ TERM: 'console' }, 4] ].forEach(([env, depth], i) => { const actual = writeStream.getColorDepth(env); assert.strictEqual( actual, depth, - `i: ${i}, expected: ${depth}, actual: ${actual}, env: ${env}` + `i: ${i}, expected: ${depth}, ` + + `actual: ${actual}, env: ${inspect(env)}` ); }); |