diff --git a/.vscode/settings.json b/.vscode/settings.json index 123ae32..8236a93 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - }, - "eslint.validate": ["javascript"] + // "editor.codeActionsOnSave": { + // "source.fixAll.eslint": true + // }, + // "eslint.validate": ["javascript"] } diff --git a/README.md b/README.md index 5737a8c..666ca57 100644 --- a/README.md +++ b/README.md @@ -94,13 +94,14 @@ Note: these assertions also require "await" Note: these assertions also require "await" -```` +``` await expect('USER_POOL_ID').toContainUser('USERNAME'); await expect('USER_POOL_ID').toContainUserWithAttributes({ Username: 'USERNAME', email: 'EMAIL@EMAIL.EMAIL', // and so on for all cognito user standard attributes - });``` + }); +``` ## Helpers @@ -108,11 +109,9 @@ Note: these assertions also require "await" AWSClient - An AWS client with credentials set up -```` - +``` getStackResources(stackName) - get information about a stack getOptions() - get options for making requests to AWS - ``` ### EventBridge @@ -122,20 +121,16 @@ An interface to the deployed EventBridge, allowing events to be injected and int #### Static ``` - - EventBridge.build(busName) - create a EventBridge instance to allow events to be injected and intercepted - +EventBridge.build(busName) - create a EventBridge instance to allow events to be injected and intercepted ``` #### Instance ``` - - eventBridge.publishEvent(source, detailType, detail) - publish an event to the bus - eventBridge.getEvents() - get the events that have been sent to the bus - eventBridge.clear() - clear old messages - eventBridge.destroy() - remove infastructure used to track events - +eventBridge.publishEvent(source, detailType, detail) - publish an event to the bus +eventBridge.getEvents() - get the events that have been sent to the bus +eventBridge.clear() - clear old messages +eventBridge.destroy() - remove infastructure used to track events ``` ### Step Functions @@ -145,17 +140,13 @@ An interface to a deployed Step Function, with a function to execute a Step Func #### Static ``` - StepFunctions.build() // create a Step Functions Client for executing existing state machines - ``` #### Instance ``` - stepFunctions.runExecution(stateMachineName, input) // executes state machine until completion - ``` ## Running with `jest` @@ -186,32 +177,31 @@ let eventBridge; const s3 = new AWSClient.S3() describe("Integration Testing Event Bridge", () => { -beforeAll(async () => { -eventBridge = await EventBridge.build("event-bridge") -}); + beforeAll(async () => { + eventBridge = await EventBridge.build("event-bridge") + }); -afterAll(async () => { -await eventBridge.destroy() -}); + afterAll(async () => { + await eventBridge.destroy() + }); -it("correctly publishes an event to the event bus when the lambda is invoked", async () => { -const event = { -body: JSON.stringify({ -filename: filename, -}), -}; + it("correctly publishes an event to the event bus when the lambda is invoked", async () => { + const event = { + body: JSON.stringify({ + filename: filename, + }), + }; // Invoke Lambda Function - const params = { - FunctionName: "event-bridge-example-dev-service1", - Payload: JSON.stringify(event), - }; - await lambda.invoke(params).promise(); - - const eventBridgeEvents = await eventBridge.getEvents() - expect(eventBridgeEvents).toHaveEvent(); - expect(eventBridgeEvents).toHaveEventWithSource("order.created"); - + const params = { + FunctionName: "event-bridge-example-dev-service1", + Payload: JSON.stringify(event), + }; + await lambda.invoke(params).promise(); + + const eventBridgeEvents = await eventBridge.getEvents() + expect(eventBridgeEvents).toHaveEvent(); + expect(eventBridgeEvents).toHaveEventWithSource("order.created"); }); it("correctly generates a PDF when an order is created", async () => { @@ -247,6 +237,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Ben Ellerby

💻 🖋 📖 🤔 🎨 📢 👀
Sarah Hamilton

💻 🖋 📖 🤔
Alex White

💻📖 +
Joel Hamilton

💻📖 @@ -256,4 +247,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + +``` + ```