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

react-component-tester

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-component-tester - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

11

package.json
{
"name": "react-component-tester",
"version": "0.0.7",
"version": "0.0.8",
"description": "A simple helper to make testing react components with shallow rendering easier",

@@ -23,3 +23,10 @@ "main": "index.js",

"shallow",
"rendering"
"rendering",
"react-test",
"react-testing",
"react-tester",
"react-component",
"react-shallow-rendering",
"react-test-help",
"react-testing-helpers"
],

@@ -26,0 +33,0 @@ "author": "Craig Bilner",

22

README.md

@@ -42,3 +42,3 @@ # react component tester

### countComponents
### .countComponents(Component{ReactComponent}) => count{int}

@@ -56,3 +56,3 @@ takes a react component and returns the number of times it appears in the rendered tree for the component under test

### findChild
### .findChild(path{string}) => child{ReactComponent}

@@ -69,3 +69,3 @@ takes a zero based decimal delimited string path and returns the resulting rendered component. this will make your tests more brittle to DOM changes but can come in handy

### findComponents
### .findComponents(Component{ReactComponent}) => [Component{ReactComponent}]

@@ -82,3 +82,3 @@ takes a react component and returns an array of all child rendered components of that type

### getState
### .getState() => state{object}

@@ -96,3 +96,3 @@ returns the current state of the given component flavour. resetState should be run after each test to ensure tests do not collide

### propFunc, mapsTo
### .propFunc(propName{string}), .mapsTo(methodName{string}) => isMapped{boolean}

@@ -115,3 +115,3 @@ propFunc takes a string which is the prop of a dumb component to which you are passing a function

### resetState
### .resetState()

@@ -122,20 +122,20 @@ returns the state of the flavour of the component under test to the initial state

### component
### component{renderedReactComponent}
the rendered component that is under test
### props
### props{object}
the props of the rendered component will be returned for each component found
### style
### style{object}
for ease of use, the style prop is placed on each component too
### type
### type{componentType}
each returned component will have a type
### value
### value{string}
if a component doesn't have any children, it's content will be added as the value property
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