react-test-query
v0.0.1
Published
ReactTestUtils wrapper
Downloads
2
Maintainers
Readme
React-test-query
React-test-query is a wrapper for the reactjs test utilities.
It offers a slightly simple API imho.
Install
npm install react-test-query
Usage
var q = require('react-test-query')
// Make a renderer
var render = q.makeRenderer(Component, defaultProps, target)
var _tree = render(newProps, function() {
// Query by class
var _comp = q(_tree)('.myComponentClass').one()
var _comps = q(_tree)('.myComponentClass').all()
// Query by tag
var _comp = q(_tree)('div').one()
var _comps = q(_tree)('div').all()
// Query by Component
var _comp = q(_tree)(Component).one()
var _comps = q(_tree)(Component).all()
})
Docs
For full documentation see the spec.
enjoy.