Skip to content

[✨] Add tooling to test hooks in isolation #9

Open
@ianlet

Description

@ianlet

Suggestion

In most cases, hooks should be an implementation detail and not tested in isolation. But, library maintainers would benefit from such features to battle test the hooks they offer to their users.

Most of the time (for simple and pure functions), hooks can be tested as a regular typescript/javascript function and won't require any tooling. In cases where hooks rely on qwik features or when they are more complex, being able to test them as if they were used within a Qwik component could be helpful.

In the React ecosystem, react-testing-library provides a renderHook function to easily render a hook and control it. It could serve as inspiration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions