{"id":30045217,"url":"https://github.com/evanoc3/jest-test-custom-events","last_synced_at":"2026-02-18T01:02:42.270Z","repository":{"id":284817786,"uuid":"956183149","full_name":"evanoc3/jest-test-custom-events","owner":"evanoc3","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-27T20:51:17.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T15:00:05.665Z","etag":null,"topics":["custom-events","jest","unit-testing"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/jest-test-custom-events","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evanoc3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-03-27T20:42:05.000Z","updated_at":"2025-03-27T20:51:20.000Z","dependencies_parsed_at":"2025-03-27T20:46:35.933Z","dependency_job_id":"ea3e3beb-88e7-43f7-a43b-37274ef1052f","html_url":"https://github.com/evanoc3/jest-test-custom-events","commit_stats":null,"previous_names":["evanoc3/jest-test-custom-events"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/evanoc3/jest-test-custom-events","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanoc3%2Fjest-test-custom-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanoc3%2Fjest-test-custom-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanoc3%2Fjest-test-custom-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanoc3%2Fjest-test-custom-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evanoc3","download_url":"https://codeload.github.com/evanoc3/jest-test-custom-events/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanoc3%2Fjest-test-custom-events/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29565016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"ssl_error","status_checked_at":"2026-02-18T00:45:26.718Z","response_time":100,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["custom-events","jest","unit-testing"],"created_at":"2025-08-07T07:32:56.332Z","updated_at":"2026-02-18T01:02:42.265Z","avatar_url":"https://github.com/evanoc3.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jest Test Custom Events\n\nAn NPM package which adds a custom matcher, `toMatchCustomEvent` to [Jest](https://jestjs.io/) allowing for the testing of properties of [CustomEvents](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent).\n\n## Installation\n\n```sh\nnpm install -D jest-test-custom-events\n```\n\n## Example Usage\n\n```typescript\nimport \"jest-test-custom-events\";\n\ntest(\"example test\", () =\u003e {\n\t// create a CustomEvent\n\tconst e = new CustomEvent(\"custom-event-name\", {\n\t\tbubbles: true,\n\t\tcomposed: true,\n\t\tdetail: {\n\t\t\texampleProperty: true\n\t\t}\n\t});\n\n\t// passes\n\texpect(e).toMatchCustomEvent({\n\t\ttype: \"custom-event-name\",\n\t\tbubbles: true,\n\t\tcomposed: true,\n\t\tdetail: {\n\t\t\texampleProperty: true\n\t\t}\n\t});\n\n\t// fails – the value for 'bubbles' does not match the received event\n\texpect(e).toMatchCustomEvent({\n\t\tbubbles: false\n\t});\n});\n```\n\nCounterintuitively, you cannot do this using the built-in `isEqual` matcher because `CustomEvent` is implemented in such a way as to make it's properties non-enumerable, and hence wil almost always pass deep equality checks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanoc3%2Fjest-test-custom-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanoc3%2Fjest-test-custom-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanoc3%2Fjest-test-custom-events/lists"}