test: add disposable histogram test

PR-URL: https://github.com/nodejs/node/pull/58384
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
James M Snell authored and Michaël Zasso committed 2025-05-31 13:30:49 +02:00
1 parent 13abca3c26
commit 5936cef60a
1 file changed
+11
@@ -97,6 +97,17 @@ const { inspect } = require('util');
}, 50);
}
{
// Tests that the ELD histogram is disposable
let histogram;
{
using hi = monitorEventLoopDelay();
histogram = hi;
}
// The histogram should already be disabled.
strictEqual(histogram.disable(), false);
}
{
const h = createHistogram();
ok(inspect(h, { depth: null }).startsWith('Histogram'));