react-test-query
ReactTestUtils wrapper
Last updated 6 years ago by asbjornenge .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-test-query 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.0.1                                ...           latest (6 years ago)

1 Versions

  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |