Skip to content

Commit

Permalink
test: improve test coverage in perf_hooks
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
juanarbol authored and BridgeAR committed Mar 5, 2019
1 parent a41138b commit 50e42c9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-http2-perf_hooks.js
Expand Up @@ -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 =
Expand Down

0 comments on commit 50e42c9

Please sign in to comment.