diff --git a/test/parallel/test-http2-perf_hooks.js b/test/parallel/test-http2-perf_hooks.js index 5dd8ad0f6d883b..9dc3f53ae57270 100644 --- a/test/parallel/test-http2-perf_hooks.js +++ b/test/parallel/test-http2-perf_hooks.js @@ -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 =