Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@saasquatch/haunted-hooks-testing-library

saasquatch9MIT1.0.1TypeScript support: included

This is a testing library for Haunted that tries to be as API compatible with React Hooks Testing Library. The motivation for this was to ensure that swapping from React to Haunted in Universal Hooks Testing Library is very easy and that the tests have th

readme

Haunted Hooks Testing Library

This is a testing library for Haunted that tries to be as API compatible with React Hooks Testing Library. The motivation for this was to ensure that swapping from React to Haunted in Universal Hooks Testing Library is very easy and that the tests have the same behavior.

Differences

Errors and storing of more than the last function call have not been implemented yet. Act doesn't actually do anything besides execute the callback.

Documentation

The API that this is based off is here: https://react-hooks-testing-library.com/reference/api

Here's what's been implemented so far:

  • act
  • renderHook (only option is initialProps)
    • result
    • rerender
    • unmount
    • waitFor
    • waitForNextUpdate
    • waitForValueToChange

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

1.0.1 - 2023-04-20

Updated

  • Updated license copyright to be in line with SaaSquatch open-source policy

1.0.0 - 2021-04-21

Added

  • Initial release