-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sarah Hamilton
authored and
agwhi
committed
May 14, 2021
1 parent
4d6d5eb
commit 4c0f47c
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default { | ||
toHaveSentEventBridgeMessage(sqsResult) { | ||
if (sqsResult.Messages) { | ||
return { | ||
message: () => `expected to have message in EventBridge Bus`, | ||
pass: true, | ||
}; | ||
} | ||
return { | ||
message: () => `no message intercepted from EventBridge Bus`, | ||
pass: false, | ||
}; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export default { | ||
toHaveSentEventWithSourceEqualTo(sqsResult, expectedSourceName) { | ||
const receivedSource = JSON.parse(sqsResult.Messages[0].Body).source; | ||
if (receivedSource == expectedSourceName) { | ||
return { | ||
message: () => | ||
`expected sent event to have source ${expectedSourceName}`, | ||
pass: true, | ||
}; | ||
} else { | ||
return { | ||
message: () => | ||
`sent event source "${receivedSource}" does not match expected source "${expectedSourceName}"`, | ||
pass: false, | ||
}; | ||
} | ||
}, | ||
}; |