test: improve test coverage in perf_hooks
PR-URL: https://github.com/nodejs/node/pull/26290 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
6f6f6d4087
commit
3826d692cc
@ -47,6 +47,14 @@ const obs = new PerformanceObserver(common.mustCall((items) => {
|
||||
assert.fail('invalid entry name');
|
||||
}
|
||||
}, 4));
|
||||
|
||||
// Should throw if entryTypes are not valid
|
||||
{
|
||||
const expectedError = { code: 'ERR_VALID_PERFORMANCE_ENTRY_TYPE' };
|
||||
const wrongEntryTypes = { entryTypes: ['foo', 'bar', 'baz'] };
|
||||
assert.throws(() => obs.observe(wrongEntryTypes), expectedError);
|
||||
}
|
||||
|
||||
obs.observe({ entryTypes: ['http2'] });
|
||||
|
||||
const body =
|
||||
|
Loading…
x
Reference in New Issue
Block a user