From 93707c491610208602875f372da2eef81a7fe94b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 28 Nov 2019 10:12:18 -0800 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil --- test/parallel/test-util-inspect.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 5c46193e837759..09ec140a19f9f1 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -2543,8 +2543,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;