New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-shallow-output

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-shallow-output

A react utility to simplify testing shallow rendered components.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

react-shallow-output

A React utility to simplify testing the output of shallow rendered components.

Getting Started

  • Install with NPM - npm install --save react-shallow-output

Usage

var shallowOutput = require('react-shallow-output');
var Component     = require('component');

describe('Component', function () {
  it('should return true is attribute is set', function () {
    var shallowComponent = shallowOutput(Component, {attribute: true});
    expect(shallowComponent.props.attribute).to.equal(true); //=> true
  });
});

Options

PropertyTypeArgumentDefaultDescription
component`stringComponent`<required>null
propsobject<required>nullprops to pass to the component.
childrenarray<optional>nullchildren to pass to the component.

Developing

react-shallow-output is built using ES6. Run the following task to compile the src/ into dist/.

npm run build

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

License

Copyright (c) 2015 Jason Bellamy & Simon Smith
Licensed under the MIT license.

Keywords

react

FAQs

Package last updated on 15 Jul 2016

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