Skip to content

Commit 5ea10a7

Browse files
Trotttargos
authored andcommitted
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: #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>
1 parent 81712c9 commit 5ea10a7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎test/parallel/test-util-inspect.js‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,8 +2511,13 @@ assert.strictEqual(
25112511
// Tracing class respects inspect depth.
25122512
try{
25132513
consttrace=require('trace_events').createTracing({categories: ['fo']});
2514-
constactual=util.inspect({ trace },{depth: 0});
2515-
assert.strictEqual(actual,'{ trace: [Tracing] }');
2514+
constactualDepth0=util.inspect({ trace },{depth: 0});
2515+
assert.strictEqual(actualDepth0,'{ trace: [Tracing] }');
2516+
constactualDepth1=util.inspect({ trace },{depth: 1});
2517+
assert.strictEqual(
2518+
actualDepth1,
2519+
"{ trace: Tracing { enabled: false, categories: 'fo' } }"
2520+
);
25162521
}catch(err){
25172522
if(err.code!=='ERR_TRACE_EVENTS_UNAVAILABLE')
25182523
throwerr;

0 commit comments

Comments
 (0)