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:
Juan José Arboleda authored and Ruben Bridgewater committed 2019-03-04 02:27:43 +01:00
1 parent 6f6f6d4087
commit 3826d692cc
1 file changed
+8
+8
View File
@@ -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 =