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

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

オープン
#14 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
195
フォーク
20
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。