summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-11-28 10:12:18 -0800
committerRich Trott <rtrott@gmail.com>2019-11-30 11:15:43 -0800
commit07ba2eb675a4b58f9c43dc2d209d96b0bec2baf3 (patch)
tree4934b4e92b8ab2d1c9b03169d673b164af1cf40b
parent5833cfd6d82baf77c6f570ef7e165479ab524dc6 (diff)
downloadandroid-node-v8-07ba2eb675a4b58f9c43dc2d209d96b0bec2baf3.tar.gz
android-node-v8-07ba2eb675a4b58f9c43dc2d209d96b0bec2baf3.tar.bz2
android-node-v8-07ba2eb675a4b58f9c43dc2d209d96b0bec2baf3.zip
test: increase coverage for trace_events.js
Add a test case to increase the test coverage for lib/trace_events.js. Refs: https://codecov.io/gh/nodejs/node/src/ea7a6f9dbd05654fff3f8c474ac0f5126bc87376/lib/trace_events.js#L70...75 PR-URL: https://github.com/nodejs/node/pull/30705 Refs: https://coverage.nodejs.org/coverage-ea7a6f9dbd05654f/lib/trace_events.js.html#L70 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
-rw-r--r--test/parallel/test-util-inspect.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index 454dfd9001..fd699c85f0 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -2544,8 +2544,13 @@ assert.strictEqual(
// Tracing class respects inspect depth.
try {
const trace = require('trace_events').createTracing({ categories: ['fo'] });
- const actual = util.inspect({ trace }, { depth: 0 });
- assert.strictEqual(actual, '{ trace: [Tracing] }');
+ const actualDepth0 = util.inspect({ trace }, { depth: 0 });
+ assert.strictEqual(actualDepth0, '{ trace: [Tracing] }');
+ const actualDepth1 = util.inspect({ trace }, { depth: 1 });
+ assert.strictEqual(
+ actualDepth1,
+ "{ trace: Tracing { enabled: false, categories: 'fo' } }"
+ );
} catch (err) {
if (err.code !== 'ERR_TRACE_EVENTS_UNAVAILABLE')
throw err;