{"id":17204522,"url":"https://github.com/bboure/sls-test-eventbridge","last_synced_at":"2025-03-25T09:43:21.438Z","repository":{"id":88814418,"uuid":"416893986","full_name":"bboure/sls-test-eventBridge","owner":"bboure","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-16T19:34:36.000Z","size":86,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T09:12:28.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bboure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-13T20:50:10.000Z","updated_at":"2022-03-29T01:54:56.000Z","dependencies_parsed_at":"2023-03-24T00:48:42.278Z","dependency_job_id":null,"html_url":"https://github.com/bboure/sls-test-eventBridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboure%2Fsls-test-eventBridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboure%2Fsls-test-eventBridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboure%2Fsls-test-eventBridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboure%2Fsls-test-eventBridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bboure","download_url":"https://codeload.github.com/bboure/sls-test-eventBridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245437205,"owners_count":20615231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T02:22:15.808Z","updated_at":"2025-03-25T09:43:21.419Z","avatar_url":"https://github.com/bboure.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test Event-driven applications with Jest\n\nThis is a POC for a framework testing EventDriven applications with Jest.\nIt leverages AppSync subscriptions to subscribe to events and implement assertion helpers.\n\nAlso see [this repo](https://github.com/bboure/appsync-eventbridge-subscriber)\nfor the AppSync part of this.\n\n# How it works\n\nIt leverages AppSync to subscribe to EventBridge Events.\nFirst, create an EventBridge spy.\nThen, execute the system under test.\nFinally, assert on the spy;\n\n```ts\nconst spy = eventBridgeSpy({ url, apiKey });\nawait eventBridge\n  .putEvents({\n    Entries: [\n      {\n        Source: 'jest',\n        DetailType: 'somethingHappened',\n        Detail: JSON.stringify({ foo: 'bar' }),\n      },\n    ],\n  })\n  .promise();\n\nawait expect(spy).toReceiveEvent();\n```\n\nAs soon as the event is received, AppSync will resolve a promise and the assertion will take place.\nIf no event is received, the promise will time out (configurable) and the assertion will assume that no event is received.\n\n# Assertions\n\n## `toReceiveEvent`\n\nTests that any event was received\n\n## `toReceiveEventWithDetailType`\n\nTests taht an event with a given detail-type was received\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbboure%2Fsls-test-eventbridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbboure%2Fsls-test-eventbridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbboure%2Fsls-test-eventbridge/lists"}