aleios-cloud / aleios-cloud/sls-test-tools

"Cannot read property 'length' of undefined" error when there is no message is SQS queue

Aperta
#14 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
195
Fork
20
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi :)

When calling the `getEvents` and that no message is present in the queue (because no events made is to EventBridge), instead of returning an empty array, or throwing a clear exception, I get:

```
TypeError: Cannot read property 'length' of undefined
at EventBridge.getEvents (/Users/georgesbiaux/Projects/Pyxo/pyxo/backend/node_modules/sls-test-tools/lib/helpers/eventBridge.js:101:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Function.getAllEventBridgeMessages (/Users/georgesbiaux/Projects/Pyxo/pyxo/backend/tests/functions/utils/event-bridge.utils.ts:76:24)
at Object. (/Users/georgesbiaux/Projects/Pyxo/pyxo/backend/tests/functions/deposit/createDepositCommand.test.ts:128:7)
```

When my test suite fails because an event has not been send correctly to EventBridge, it would be clearer if it was the assertion on the event that cause the failure :)

Thanks

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.