MCPcopy Index your code
hub / github.com/nodejs/node / onceAnEventWithInvalidOptions

Function onceAnEventWithInvalidOptions

test/parallel/test-events-once.js:21–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21async function onceAnEventWithInvalidOptions() {
22 const ee = new EventEmitter();
23
24 await Promise.all([1, 'hi', null, false, () => {}, Symbol(), 1n].map((options) => {
25 return assert.rejects(once(ee, 'myevent', options), {
26 code: 'ERR_INVALID_ARG_TYPE',
27 });
28 }));
29}
30
31async function onceAnEventWithTwoArgs() {
32 const ee = new EventEmitter();

Callers 1

Calls 4

allMethod · 0.80
onceFunction · 0.70
mapMethod · 0.65
SymbolFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…