mattroylloyd / react-component-tape-util

Testing React Components without all that boilerplate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Component Tape Util

Tape wrapper for testing React components without the boilerplate

Example

import React from 'react'
import { test, renderJsx } from 'react-component-tape-util'

import HelloWorld from './HelloWorld' // () => <h1>Hello, world!</h1>

test('component.HelloWorld', assert => {
  const expected = <h1>Hello, world!</h1>
  const actual = renderJsx(<HelloWorld />)

  // jsxEquals is now included in the assert library
  assert.jsxEquals(actual, expected, 'should render correctly')
})

About

Testing React Components without all that boilerplate

License:ISC License


Languages

Language:JavaScript 100.0%