diff options
author | Benjamin Zaslavsky <benjamin.zaslavsky@gmail.com> | 2017-11-14 23:59:57 +0100 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2017-11-18 12:38:59 +0100 |
commit | 45e6642476389fe5442c23b08a3ea99fcc752e56 (patch) | |
tree | 3f0f659e41d4d9c0d70258e35d5b691f4068e03f /test/parallel/test-console.js | |
parent | 0a1fba02a65b0b6bb53ca2d6966eaca67265e7d6 (diff) | |
download | android-node-v8-45e6642476389fe5442c23b08a3ea99fcc752e56.tar.gz android-node-v8-45e6642476389fe5442c23b08a3ea99fcc752e56.tar.bz2 android-node-v8-45e6642476389fe5442c23b08a3ea99fcc752e56.zip |
console: add support for console.debug
Adds the console.debug() method, alias for console.log(). This method is
exposed by V8 and was only available in inspector until now. Also adds
matching test and documentation.
PR-URL: https://github.com/nodejs/node/pull/17033
Refs: https://github.com/nodejs/node/pull/17004
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-console.js')
-rw-r--r-- | test/parallel/test-console.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index b3d3dedb72..eadb3a32a1 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -69,6 +69,13 @@ console.log('%s %s', 'foo', 'bar', 'hop'); console.log({ slashes: '\\\\' }); console.log(custom_inspect); +// test console.debug() goes to stdout +console.debug('foo'); +console.debug('foo', 'bar'); +console.debug('%s %s', 'foo', 'bar', 'hop'); +console.debug({ slashes: '\\\\' }); +console.debug(custom_inspect); + // test console.info() goes to stdout console.info('foo'); console.info('foo', 'bar'); @@ -154,6 +161,10 @@ for (const expected of expectedStrings) { assert.strictEqual(errStrings.shift(), `${expected}\n`); } +for (const expected of expectedStrings) { + assert.strictEqual(strings.shift(), `${expected}\n`); +} + assert.strictEqual(strings.shift(), "{ foo: 'bar', inspect: [Function: inspect] }\n"); assert.strictEqual(strings.shift(), |