{"id":18909543,"url":"https://github.com/neovici/testing","last_synced_at":"2026-02-07T00:17:37.202Z","repository":{"id":149005055,"uuid":"620852376","full_name":"Neovici/testing","owner":"Neovici","description":"Testing library utilities","archived":false,"fork":false,"pushed_at":"2024-01-11T11:52:04.000Z","size":422,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-31T14:19:02.925Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neovici.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-03-29T13:54:32.000Z","updated_at":"2023-03-29T22:14:59.000Z","dependencies_parsed_at":"2024-11-08T09:35:39.959Z","dependency_job_id":"47aa7311-0b42-4b88-85c8-9ca163ebed1a","html_url":"https://github.com/Neovici/testing","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neovici%2Ftesting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neovici%2Ftesting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neovici%2Ftesting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neovici%2Ftesting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neovici","download_url":"https://codeload.github.com/Neovici/testing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239897025,"owners_count":19715138,"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-11-08T09:34:10.740Z","updated_at":"2026-01-22T11:02:38.908Z","avatar_url":"https://github.com/Neovici.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# testing\nTesting library utilities\n\n## renderHook\n\nThe `renderHook` function allows you to test hooks in isolation for web components using Pion.js.\n\n### Basic Usage\n\n```typescript\nimport { renderHook } from '@neovici/testing';\nimport { useState, useCallback } from '@pionjs/pion';\n\nfunction useCounter() {\n  const [count, setCount] = useState(0);\n  const increment = useCallback(() =\u003e setCount(count + 1), [count]);\n  return { count, increment };\n}\n\ndescribe('useCounter', () =\u003e {\n  it('should return initial count', async () =\u003e {\n    const { result } = await renderHook(() =\u003e useCounter());\n    expect(result.current.count).to.equal(0);\n  });\n});\n```\n\n### Return Value\n\nThe `renderHook` function returns an object with the following properties:\n\n- `result`: The current result of the hook execution\n- `rerender(newProps?)`: Re-render the hook with new props\n- `unmount()`: Unmount the hook and cleanup\n- `nextUpdate(message?, options?)`: Wait for the next update\n- `host`: The host element (HTMLElement) for hooks that need direct host access\n\n### Options\n\n- `initialProps`: Initial props to pass to the hook\n- `wrapper`: A wrapper function to wrap the hook rendering\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneovici%2Ftesting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneovici%2Ftesting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneovici%2Ftesting/lists"}