From 3826d692cc60cf8a7ea6dc48b425fd75dcc697df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= Date: Sun, 24 Feb 2019 13:51:50 -0500 Subject: [PATCH] test: improve test coverage in perf_hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/26290 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Anto Aravinth Reviewed-By: Ruben Bridgewater --- test/parallel/test-http2-perf_hooks.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/parallel/test-http2-perf_hooks.js b/test/parallel/test-http2-perf_hooks.js index 5dd8ad0f6d883b..4264915294827c 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 =