From 0fd49f1d5e0f8425b6c81d1f34c07b4b2befd83f Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Sat, 31 Dec 2022 06:52:54 +0900 Subject: [PATCH] add more invalid data types to test case --- test/parallel/test-events-on-async-iterator.js | 2 +- test/parallel/test-events-once.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-events-on-async-iterator.js b/test/parallel/test-events-on-async-iterator.js index 0083d1d7281a59..057af8537f3275 100644 --- a/test/parallel/test-events-on-async-iterator.js +++ b/test/parallel/test-events-on-async-iterator.js @@ -43,7 +43,7 @@ async function invalidArgType() { const ee = new EventEmitter(); - [1, 'hi', null, false].map((options) => { + [1, 'hi', null, false, () => {}, Symbol(), 1n].map((options) => { return assert.throws(() => on(ee, 'foo', options), common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', diff --git a/test/parallel/test-events-once.js b/test/parallel/test-events-once.js index 7b7f1697ead120..1a82824d4ad922 100644 --- a/test/parallel/test-events-once.js +++ b/test/parallel/test-events-once.js @@ -27,7 +27,7 @@ async function onceAnEvent() { async function onceAnEventWithInvalidOptions() { const ee = new EventEmitter(); - await Promise.all([1, 'hi', null, false].map((options) => { + await Promise.all([1, 'hi', null, false, () => {}, Symbol(), 1n].map((options) => { return rejects(once(ee, 'myevent', options), { code: 'ERR_INVALID_ARG_TYPE', });