A common pattern in our tests is to render a component and add the wrapper and (optionally) its DOM container to a list of active wrappers/containers. At the end of the test a Mocha afterEach block is then used to ensure all components are unmounted.
This commit adds mount and unmountAll utilities to this package to simplify this pattern. The mount function renders the component and adds its wrapper to the active set. unmountAll unmounts all active wrappers.
A common pattern in our tests is to render a component and add the wrapper and (optionally) its DOM container to a list of active wrappers/containers. At the end of the test a Mocha
afterEach
block is then used to ensure all components are unmounted.This commit adds
mount
andunmountAll
utilities to this package to simplify this pattern. Themount
function renders the component and adds its wrapper to the active set.unmountAll
unmounts all active wrappers.