summaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-buffer-list.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2017-12-28 23:40:30 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-01-16 15:34:03 +0100
commitb994b8eff6018433a56bb10dbc473cefa0dd9370 (patch)
tree018ee50d8c636219348747431053d7cd2a1405ca /test/parallel/test-stream-buffer-list.js
parent9d3958102ec28f2bb468b2c532b7b34cabd61f1b (diff)
downloadandroid-node-v8-b994b8eff6018433a56bb10dbc473cefa0dd9370.tar.gz
android-node-v8-b994b8eff6018433a56bb10dbc473cefa0dd9370.tar.bz2
android-node-v8-b994b8eff6018433a56bb10dbc473cefa0dd9370.zip
util: change util.inspect depth default
The current default is not ideal in most use cases. Therefore it is changed to showing unlimited depth in case util.inspect is called directly. The default is kept as before for console.log and similar. Using console.dir will now show a depth of up to five and console.assert / console.trace will show a unlimited depth. PR-URL: https://github.com/nodejs/node/pull/17907 Refs: https://github.com/nodejs/node/issues/12693 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'test/parallel/test-stream-buffer-list.js')
-rw-r--r--test/parallel/test-stream-buffer-list.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-stream-buffer-list.js b/test/parallel/test-stream-buffer-list.js
index ddbff452de..87c9d2a2bb 100644
--- a/test/parallel/test-stream-buffer-list.js
+++ b/test/parallel/test-stream-buffer-list.js
@@ -3,6 +3,7 @@
require('../common');
const assert = require('assert');
const BufferList = require('internal/streams/BufferList');
+const util = require('util');
// Test empty buffer list.
const emptyList = new BufferList();
@@ -25,3 +26,10 @@ assert.strictEqual(list.join(','), 'foo');
const shifted = list.shift();
assert.strictEqual(shifted, 'foo');
assert.deepStrictEqual(list, new BufferList());
+
+const tmp = util.inspect.defaultOptions.colors;
+util.inspect.defaultOptions = { colors: true };
+assert.strictEqual(
+ util.inspect(list),
+ 'BufferList { length: \u001b[33m0\u001b[39m }');
+util.inspect.defaultOptions = { colors: tmp };