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

test-drive-react

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.


Version published
Weekly downloads
10
decreased by-71.43%
Maintainers
2
Weekly downloads
 
Created

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 06 Apr 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