{"id":24782210,"url":"https://github.com/nashaddams/ddom","last_synced_at":"2026-05-06T21:30:57.864Z","repository":{"id":274533175,"uuid":"923210518","full_name":"nashaddams/ddom","owner":"nashaddams","description":"Testing utilities for React components and vanilla HTML/JS","archived":false,"fork":false,"pushed_at":"2025-10-05T17:55:39.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T19:34:06.153Z","etag":null,"topics":["deno","jsdom","react","react-testing-library"],"latest_commit_sha":null,"homepage":"https://jsr.io/@nashaddams/ddom","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/nashaddams.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}},"created_at":"2025-01-27T20:32:00.000Z","updated_at":"2025-10-05T17:53:11.000Z","dependencies_parsed_at":"2025-03-24T05:28:19.796Z","dependency_job_id":"457fc8a7-aecb-4b4e-9044-898ead237db0","html_url":"https://github.com/nashaddams/ddom","commit_stats":null,"previous_names":["nashaddams/ddom"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/nashaddams/ddom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashaddams%2Fddom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashaddams%2Fddom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashaddams%2Fddom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashaddams%2Fddom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nashaddams","download_url":"https://codeload.github.com/nashaddams/ddom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashaddams%2Fddom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32712650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T19:35:05.142Z","status":"ssl_error","status_checked_at":"2026-05-06T19:35:03.996Z","response_time":117,"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":["deno","jsdom","react","react-testing-library"],"created_at":"2025-01-29T11:16:32.222Z","updated_at":"2026-05-06T21:30:57.857Z","avatar_url":"https://github.com/nashaddams.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DDOM\n\n[![JSR](https://jsr.io/badges/@nashaddams/ddom)](https://jsr.io/@nashaddams/ddom)\n[![JSR score](https://jsr.io/badges/@nashaddams/ddom/score)](https://jsr.io/@nashaddams/ddom)\n[![main](https://github.com/nashaddams/ddom/actions/workflows/tests.yml/badge.svg)](https://github.com/nashaddams/ddom/actions)\n\nTesting utilities for React components and vanilla HTML/JS, powered by\n[`JSDOM`](https://github.com/jsdom/jsdom).\n\n## Usage\n\n```tsx\nimport { useState } from \"react\";\n\nexport function Counter({ initialCount }: { initialCount: number }) {\n  const [count, setCount] = useState(initialCount);\n  const increment = () =\u003e setCount((prev) =\u003e prev + 1);\n\n  return (\n    \u003cdiv\u003e\n      \u003cspan\u003eCurrent value:\u0026nbsp;\u003c/span\u003e\n      \u003cspan data-testid=\"count\"\u003e{count}\u003c/span\u003e\n      \u003cbutton data-testid=\"increment\" onClick={increment}\u003e\n        Increment\n      \u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n```tsx\nimport { DDOM, getByTestId, waitFor } from \"@nashaddams/ddom\";\nimport { createRoot } from \"react-dom/client\";\nimport { Counter } from \"./counter.tsx\";\n\nDeno.test(\"should render and interact with a react component\", async () =\u003e {\n  using _ = DDOM.register();\n\n  const root = document.getElementById(\"root\")!;\n  assertEquals(root.children.length, 0);\n\n  createRoot(root).render(\u003cCounter initialCount={4711} /\u003e);\n  await waitFor(() =\u003e assertGreater(root.children.length, 0));\n\n  const count = getByTestId(\"count\");\n\n  getByTestId\u003cHTMLButtonElement\u003e(\"increment\").click();\n  await waitFor(() =\u003e assertEquals(count.textContent, \"4712\"));\n});\n```\n\n### `JSDOM` only\n\nIf you prefer to only add [`JSDOM`](https://github.com/jsdom/jsdom) as a\ndependency, you can register the DOM globals manually:\n\n```ts\n// @ts-types=\"npm:@types/jsdom@27.0.0\"\nimport { JSDOM } from \"npm:jsdom@27.0.0\";\n\nconst dom = new JSDOM(`\u003c!-- HTML --\u003e`);\n\n(globalThis as any).window = dom.window;\n(globalThis as any).document = dom.window.document;\n```\n\nSee [the docs](https://jsr.io/@nashaddams/ddom/doc) for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnashaddams%2Fddom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnashaddams%2Fddom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnashaddams%2Fddom/lists"}