test: test for pool event emitter property
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 12 Jul 2023 11:26:11 +0000 (13:26 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 12 Jul 2023 11:26:11 +0000 (13:26 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/test-utils.js

index 177a5c28e5e13e57284318fb77ea58005bdc06dd..67d10e4a93e690c3cd70f6fc3d2e63641f91ff83 100644 (file)
@@ -23,7 +23,7 @@ const waitPoolEvents = async (pool, poolEvent, numberOfEventsToWait) => {
     if (numberOfEventsToWait === 0) {
       resolve(events)
     }
-    pool?.emitter.on(poolEvent, () => {
+    pool.emitter?.on(poolEvent, () => {
       ++events
       if (events === numberOfEventsToWait) {
         resolve(events)