# abstract-react-component-jest-mount

> Mount Abstract React Components for Jest Testing

Latest version **0.1.3** (published 2018-12-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install abstract-react-component-jest-mount
pnpm add abstract-react-component-jest-mount
yarn add abstract-react-component-jest-mount
bun add abstract-react-component-jest-mount
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2018-12-15 |
| First published | 2018-12-11 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 168.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Chris Abrams |
| Maintainers | chrisabrams |

## Links

- npm: https://www.npmjs.com/package/abstract-react-component-jest-mount
- Repository: https://github.com/chrisabrams/abstract-react-component-jest-mount
- Homepage: https://github.com/chrisabrams/abstract-react-component-jest-mount#readme
- Issues: https://github.com/chrisabrams/abstract-react-component-jest-mount/issues
- npm.io page: https://npm.io/package/abstract-react-component-jest-mount

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.6.3
- [react-dom](https://npm.io/package/react-dom.md) ^16.6.3

## Recent versions

- 0.1.3 (latest) — 2018-12-15
- 0.1.2 — 2018-12-12
- 0.1.1 — 2018-12-11
- 0.1.0 — 2018-12-11

## README

# Abstract React Component Jest Mount
Mount Abstract React Components for Jest Testing

## Usage

    yarn add abstract-react-component-jest-mount --dev

```
interface IProps {
  message: string
}

class SomeClass extends React.Component<IProps> {

  public static defaultProps: Partial<IProps> = {
    message: 'Hello World!'
  }

  mode = 'default'

  state = {
    foo: 'bar'
  }

  type: string

  constructor(props) {
    super(props)

    props.setRoot(this)

    this.type = 'derived'
  }

  render() {
    return <div>{this.props.message}</div>
  }

}

const { ref, root, unmount } = mount(<SomeClass />)
```

- `ref` The React reference to the component mounted.
- `root` The `this` scope to the component mounted.
- `unmount` Clean up the component from the DOM. Required if multiple tests use mount.

---
_Source: https://npm.io/package/abstract-react-component-jest-mount · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
