New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

abstract-react-component-jest-mount

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstract-react-component-jest-mount

Mount Abstract React Components for Jest Testing

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 15 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc