���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /home/real/node-v13.0.1/test/parallel/ |
'use strict'; // Flags: --expose-internals require('../common'); const stream = require('stream'); const REPL = require('internal/repl'); const assert = require('assert'); const inspect = require('util').inspect; const tests = [ { env: {}, expected: { terminal: true, useColors: true } }, { env: { NODE_DISABLE_COLORS: '1' }, expected: { terminal: true, useColors: false } }, { env: { NODE_NO_READLINE: '1' }, expected: { terminal: false, useColors: false } }, { env: { TERM: 'dumb' }, expected: { terminal: true, useColors: false } }, { env: { NODE_NO_READLINE: '1', NODE_DISABLE_COLORS: '1' }, expected: { terminal: false, useColors: false } }, { env: { NODE_NO_READLINE: '0' }, expected: { terminal: true, useColors: true } } ]; function run(test) { const env = test.env; const expected = test.expected; const opts = { terminal: true, input: new stream.Readable({ read() {} }), output: new stream.Writable({ write() {} }) }; Object.assign(process.env, env); REPL.createInternalRepl(process.env, opts, function(err, repl) { assert.ifError(err); assert.strictEqual(repl.terminal, expected.terminal, `Expected ${inspect(expected)} with ${inspect(env)}`); assert.strictEqual(repl.useColors, expected.useColors, `Expected ${inspect(expected)} with ${inspect(env)}`); for (const key of Object.keys(env)) { delete process.env[key]; } repl.close(); }); } tests.forEach(run);