# tape-jsx-notequals

> tape extension to assert two jsx strings are not equal

Latest version **1.0.3** (published 2016-02-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install tape-jsx-notequals
pnpm add tape-jsx-notequals
yarn add tape-jsx-notequals
bun add tape-jsx-notequals
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2016-02-09 |
| First published | 2016-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | John Oerter |
| Maintainers | joerter |
| Keywords | tape, react, jsx |

## Links

- npm: https://www.npmjs.com/package/tape-jsx-notequals
- Repository: https://github.com/joerter/tape-jsx-notEquals
- Homepage: https://github.com/joerter/tape-jsx-notEquals#readme
- Issues: https://github.com/joerter/tape-jsx-notEquals/issues
- npm.io page: https://npm.io/package/tape-jsx-notequals

## Dependencies (1)

- [react-element-to-jsx-string](https://npm.io/package/react-element-to-jsx-string.md) ^2.4.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2016-02-09
- 1.0.2 — 2016-02-09
- 1.0.1 — 2016-02-09
- 1.0.0 — 2016-02-09

## README

# tape-jsx-notEquals
Extension assertion for tape and jsx

[![npm](https://img.shields.io/npm/v/tape-jsx-notequals.svg)](https://www.npmjs.com/package/tape-jsx-notequals)
[![npm](https://img.shields.io/npm/l/tape-jsx-notequals.svg)](https://www.npmjs.com/package/tape-jsx-notequals)

[Tape](https://github.com/substack/tape) [extension](https://github.com/atabel/extend-tape) to assert two jsx strings are not equal.

`tape-jsx-notequals` uses [`react-element-to-jsx-string`](https://github.com/algolia/react-element-to-jsx-string) to compare two components'
rendered output.

## Install
```
$ npm install --save-dev extend-tape
$ npm install --save-dev tape-jsx-notequals
```
## How to use

Testing React components is very easy with `tape` + `tape-jsx-notequals`:

```javascript
const MyComponent = function ({color}) {
    const className = `box color-${color}`;
    return (
        <div className={className}></div>
    );
};
```

```javascript
import {createRenderer} from 'react-addons-test-utils';
import tape from 'tape';
import addAssertions from 'extend-tape';
import jsxNotEquals from 'tape-jsx-notequals';
import MyComponent from '../MyComponent';

// extend tape with jsxNotEqual assertion:
const test = addAssertions(tape, {jsxNotEquals});

test('MyComponent is not red', (t) => {
  const renderer = createRenderer();
  renderer.render(<MyComponent color="blue" />);
  const result = renderer.getRenderOutput();

  t.jsxNotEquals(result, <div className="box color-red"></div>);
  t.end();
});
```

## Run tests
```
$ npm install
$ npm test

---
_Source: https://npm.io/package/tape-jsx-notequals · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
