# enzyme-cleanup

> a utility to unmount enzyme renders

Latest version **1.1.2** (published 2019-10-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install enzyme-cleanup
pnpm add enzyme-cleanup
yarn add enzyme-cleanup
bun add enzyme-cleanup
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2019-10-22 |
| First published | 2019-10-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Clint Goodman |
| Maintainers | cgood92 |
| Keywords | enzyme, cleanup, unmount, render |

## Links

- npm: https://www.npmjs.com/package/enzyme-cleanup
- Repository: https://github.com/cgood92/enzyme-cleanup
- Homepage: https://github.com/cgood92/enzyme-cleanup#readme
- Issues: https://github.com/cgood92/enzyme-cleanup/issues
- npm.io page: https://npm.io/package/enzyme-cleanup

## Recent versions

- 1.1.2 (latest) — 2019-10-22
- 1.1.1 — 2019-10-22
- 1.1.0 — 2019-10-22
- 1.0.0 — 2019-10-22

## README

# enzyme-cleanup

## Purpose
To be able to provide a quick utility to unmount [enzyme](https://airbnb.io/enzyme/) tests.

See [this issue](https://github.com/airbnb/enzyme/issues/911) for more information.

## To install

```bash
npm i -D eynzme-cleanup 
# or yarn add -D eynzme-cleanup
```

Then, add this to your jest [setup script](https://jestjs.io/docs/en/configuration.html#setupfilesafterenv-array).

```js
import { configure } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import { cleanup, makeAdapter } from 'enzyme-cleanup'

// afterEach is a global jest method
afterEach(cleanup)

configure({ adapter: makeAdapter(Adapter) })
```

If you are not using [jest](https://jestjs.io/), you can call `enzymeCleanup()` however you see fit.

Can be used with any [enzyme adapter](https://airbnb.io/enzyme/docs/installation/#working-with-react-16).

Works on [shallow](https://airbnb.io/enzyme/docs/api/shallow.html), [mount](https://airbnb.io/enzyme/docs/api/mount.html), or [render](https://airbnb.io/enzyme/docs/api/render.html) wrappers of enzyme.

---
_Source: https://npm.io/package/enzyme-cleanup · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
