-
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
1 parent
c48c64b
commit df8c58e
Showing
19 changed files
with
242 additions
and
84 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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { testResult } from "../../utils/testResult"; | ||
import { SQS } from "aws-sdk"; | ||
import { testResult, TestResultOutput } from "utils/testResult"; | ||
|
||
export default { | ||
toHaveEvent(eventBridgeEvents: any) { | ||
let message; | ||
if (eventBridgeEvents) { | ||
message = "expected to have message in EventBridge Bus"; | ||
|
||
return testResult(message, true); | ||
toHaveEvent(eventBridgeEvents?: SQS.ReceiveMessageResult): TestResultOutput { | ||
if ( | ||
eventBridgeEvents === undefined || | ||
eventBridgeEvents.Messages === undefined || | ||
eventBridgeEvents.Messages.length === 0 | ||
) { | ||
return testResult("no message intercepted from EventBridge Bus", false); | ||
} | ||
message = "no message intercepted from EventBridge Bus"; | ||
|
||
return testResult(message, false); | ||
return testResult("expected to have message in EventBridge Bus", true); | ||
}, | ||
}; |
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
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
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
type Error404 = { statusCode: 404 }; | ||
export const is404Error = (error: any): error is Error404 => | ||
error.statusCode === 404; | ||
export const is404Error = (error: unknown): error is Error404 => | ||
(error as { statusCode?: number }).statusCode === 404; | ||
|
||
type ErrorNoSuchKey = { code: "NoSuchKey" }; | ||
export const isNoSuchKeyError = (error: any): error is ErrorNoSuchKey => | ||
error.code === "NoSuchKey"; | ||
export const isNoSuchKeyError = (error: unknown): error is ErrorNoSuchKey => | ||
(error as { code?: string }).code === "NoSuchKey"; | ||
|
||
type ErrorNoSuchBucket = { code: "NoSuchBucket" }; | ||
export const isNoSuchBucketError = (error: any): error is ErrorNoSuchBucket => | ||
error.code === "NoSuchBucket"; | ||
export const isNoSuchBucketError = ( | ||
error: unknown | ||
): error is ErrorNoSuchBucket => | ||
(error as { code?: string }).code === "NoSuchBucket"; |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
type GlobalWithExpectKey = { expect: any }; | ||
export const isGlobalWithExpectKey = ( | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
global: any | ||
): global is GlobalWithExpectKey => "expect" in global; |
Oops, something went wrong.