Skip to content

kwltrs/tape-jsx-assertions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tape-jsx-assertions

Tape extension inspired by tape-jsx-equals.

Install

Requires extend-tape.

$ npm install --save-dev @kwltrs/tape-jsx-assertions
$ npm install --save-dev extend-tape

Usage

import tape from 'tape';
import jsxAssertions from '@kwltrs/tape-jsx-assertions';
import addAssertions from 'extend-tape';

const test = addAssertions(tape, jsxAssertions);

Example

import { createRenderer } from 'react-addons-test-utils';
import MyThingie from './MyThingie';

test('MyThingie', (t) {
  const renderer = createRenderer();
  renderer.render( <MyThingie /> );
  const result = renderer.getRenderOutput();

  t.jsxEquals(result, <div><p className='foo'>bar</p></div>);
  t.jsxIncludes(result, <p className='foo'>bar</p>);

  t.end();
});

Assertions

t.jsxEquals(actual, expected, msg)

t.jsxIncludes(actual, expected, msg)

t.jsxNotEquals(actual, expected, msg)

t.jsxNotIncludes(actual, expected, msg)

License

Fair License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published