mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
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>
This commit is contained in:
1 parent
a715c2506b
commit
e624bb529d
1 file changed
+7
-2
@@ -2511,8 +2511,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;
|
||||
|
||||
Reference in new issue
Block a user