API
isolate-react exposes three functions: isolateHook, isolateComponent, and isolateComponentTree.
Import them as follows:
import { isolateComponent, isolateComponentTree, isolateHook } from 'isolate-react'
Each function serves a different purpose:
isolateHookis used for testing custom hooks.isolateComponentis used for testing a single compoment without rendering its child components, similar to "shallow" rendering with a tool like enzyme.isolateComponentTreeis used for testing a compoment with all of its children.
Learn about testing components:
- [Overview and Examples](./Testing Components/01-overview.md)
- [API](./Testing Components/api.md)
Learn about testing hooks:
- [Overview and Examples](./Testing Hooks/01-overview.md)
- [API](./Testing Hooks/api.md)