Skip to content

Commit 40d52fb

Browse files
jdiaz-devjuanarbol
authored andcommitted
test: add test to once() in event lib
This test verify if eventEmmiter param is right PR-URL: #46126 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
1 parent 2497702 commit 40d52fb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/parallel/test-events-once.js

+8
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ async function onceWithEventTargetError() {
150150
strictEqual(err, error);
151151
}
152152

153+
async function onceWithInvalidEventEmmiter() {
154+
const ac = new AbortController();
155+
return rejects(once(ac, 'myevent'), {
156+
code: 'ERR_INVALID_ARG_TYPE',
157+
});
158+
}
159+
153160
async function prioritizesEventEmitter() {
154161
const ee = new EventEmitter();
155162
ee.addEventListener = fail;
@@ -256,6 +263,7 @@ Promise.all([
256263
onceError(),
257264
onceWithEventTarget(),
258265
onceWithEventTargetError(),
266+
onceWithInvalidEventEmmiter(),
259267
prioritizesEventEmitter(),
260268
abortSignalBefore(),
261269
abortSignalAfter(),

0 commit comments

Comments
 (0)