Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 40d52fb

Browse filesBrowse 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 <yagiz@nizipli.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 2497702 commit 40d52fb
Copy full SHA for 40d52fb

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-events-once.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-events-once.js
+8Lines changed: 8 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.