Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

test-drive-react

Package Overview
Dependencies
Maintainers
2
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-drive-react

Opinionated library for Test-Driven Development of React Components.

  • 0.1.83
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
80
increased by26.98%
Maintainers
2
Weekly downloads
 
Created
Source

Test Drive React

Opinionated library for Test-Driven Development of React components, extending Test Drive and providing its timing functions, DOM parts lookup, presence/absence matchers and layout matchers.

In addition, it reexports React simulate testing utility and integrated renderer

ClientRenderer

ClientRenderer provides a utility for rendering React components in consistent and convenient way. It creates the holding container, if necessary, with uniform positioning, automatically binds to it all important Test Drive helper functions, and proivides clean-up mechanism.

For a typical use, see the end-to-end test.

The renderer is created simply by invoking new ClientRenderer().

render(element, container?)

Renders the element React component. If container is not specified, a new one is created. Returns RenderingContext with following fields:

  • container
  • result - rendered root component (either DOM Element or React component instance)
  • select - DOM selector pre-bound to the container
  • waitForDom - DOM timing function pre-bound to the container

cleanup()

Unmounts the root component and removes any container that had been created by the renderer.

FAQs

Package last updated on 11 Jun 2017

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